[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDFJava #RAN-171087]: "javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection" for proxy connections



> The netCDF-java version you provided seems to work also with a Proxy.
Good.
> 
> The below printed code accesses a CFSR grib2 file on the nomads OPeNDAP 
> server, downloads and prints the included values for air temperature 
> correctly, while being behind our proxy.
> 
> I conclude the error has to be somewhere in the Matlab handling of the netCDF 
> API.
Ok, then I will close this issue.

> 
> Thanks a lot for the help and advice.
> 
> 
> 
> // version 4.6.10
> import ucar.nc2.dataset.NetcdfDataset;
> import ucar.httpservices.HTTPSession;
> import ucar.nc2.Variable;
> import java.lang.Throwable;
> import java.util.List;
> import ucar.ma2.Array;
> import ucar.ma2.DataType;
> 
> public class JavaProxyTest {
> public static void main( String[] args ) {
> 
> NetcdfDataset ncd = null;
> String        url;
> String        proxyurl;
> 
> String        title;
> String        location;
> 
> Variable      var;
> Array         values;
> int[]         shape;
> DataType      type;
> 
> url       = 
> "https://nomads.ncdc.noaa.gov/thredds/dodsC/modeldata/cmd_pgbh/2008/200811/20081101/pgbh00.gdas.2008110100.grb2";;
> proxyurl  = "http://proxy-et.iosb.fraunhofer.de:80";;
> 
> try {
> HTTPSession.setGlobalProxy(proxyurl);
> 
> ncd      = NetcdfDataset.openDataset(url);
> title    =  ncd.getTitle();
> location = ncd.getLocation();
> 
> var = ncd.findVariable("Temperature_height_above_ground");
> 
> shape = var.getShape();
> type  = var.getDataType();
> values = Array.factory(type,shape);
> values   = var.read();
> 
> System.out.println( location );
> System.out.println( " " + shape[0] +" "+  shape[1] +" "+  shape[2] +" "+ 
> shape[3]);
> System.out.println( "Variable value of 1st line and 1st column:"+ 
> values.getDouble(0) );
> System.out.println( "Variable value of 2nd line and 1st column:"+ 
> values.getDouble(720) );
> System.out.println( "Variable value of 3rd line and 1st column:"+ 
> values.getDouble(720+720) );
> 
> } catch(Exception e) {
> e.printStackTrace();
> } finally {
> try {
> ncd.close();
> } catch(Exception e) {
> e.printStackTrace();
> }
> }
> }
> }
> 
> --
> Dipl.-Phys. Marius Kist
> Fraunhofer-Institut für Optronik, Systemtechnik und Bildauswertung IOSB
> Abteilung Signatorik
> Gutleuthausstr. 1, 76275 Ettlingen, Germany
> Phone +49 7243 992-223
> address@hidden
> www.iosb.fraunhofer.de/sig
> 

=Dennis Heimbigner
  Unidata


Ticket Details
===================
Ticket ID: RAN-171087
Department: Support netCDF Java
Priority: Normal
Status: Closed
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.