hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bela Roboz (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HTTPCLIENT-1785) If you use custom trust manager/ protocol the "connection.timeout" param will throw SSLHandshakeException
Date Thu, 20 Oct 2016 17:57:58 GMT

     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1785?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Bela Roboz updated HTTPCLIENT-1785:
-----------------------------------
    Description: 
Example:

	X509TrustManager manager=UtilsSSL.getX509TrustManager("d:/tmpkulcstarolo.jks","???");
	URL cel2=new URL("https://www.your_domain.com:443/tmp/alma/teszt.php");
	
	
	Protocol myhttps = new Protocol("https", new EgyediSSLProtocolSocketFactory(manager), 443);
	
	HttpClient httpclient = new HttpClient();
	httpclient.getHostConfiguration().setHost("www.conforg.hu", 443, myhttps);
          // The next row cause exception, without this everything ok	
         httpclient.getHttpConnectionManager().getParams().setConnectionTimeout(5000);
	GetMethod httpget = new GetMethod("/tmp/alma/teszt.php?sajt=hihike");
	try {
	  httpclient.executeMethod(httpget);
	  System.out.println(httpget.getResponseBodyAsString());
	} finally {
	  httpget.releaseConnection();
	}

  was:
Example:

	X509TrustManager manager=UtilsSSL.getX509TrustManager("d:/tmpkulcstarolo.jks","???");
	URL cel2=new URL("https://www.your_domain.com:443/tmp/alma/teszt.php");
	
	
	Protocol myhttps = new Protocol("https", new EgyediSSLProtocolSocketFactory(manager), 443);
	
	HttpClient httpclient = new HttpClient();
	httpclient.getHostConfiguration().setHost("www.conforg.hu", 443, myhttps);
// The next row cause exception, without this everything ok	httpclient.getHttpConnectionManager().getParams().setConnectionTimeout(5000);
	GetMethod httpget = new GetMethod("/tmp/alma/teszt.php?sajt=hihike");
	try {
	  httpclient.executeMethod(httpget);
	  System.out.println(httpget.getResponseBodyAsString());
	} finally {
	  httpget.releaseConnection();
	}


> If you use custom trust manager/ protocol the "connection.timeout" param will throw SSLHandshakeException
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1785
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1785
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient (classic)
>    Affects Versions: 3.1 (end of life)
>            Reporter: Bela Roboz
>
> Example:
> 	X509TrustManager manager=UtilsSSL.getX509TrustManager("d:/tmpkulcstarolo.jks","???");
> 	URL cel2=new URL("https://www.your_domain.com:443/tmp/alma/teszt.php");
> 	
> 	
> 	Protocol myhttps = new Protocol("https", new EgyediSSLProtocolSocketFactory(manager),
443);
> 	
> 	HttpClient httpclient = new HttpClient();
> 	httpclient.getHostConfiguration().setHost("www.conforg.hu", 443, myhttps);
>           // The next row cause exception, without this everything ok	
>          httpclient.getHttpConnectionManager().getParams().setConnectionTimeout(5000);
> 	GetMethod httpget = new GetMethod("/tmp/alma/teszt.php?sajt=hihike");
> 	try {
> 	  httpclient.executeMethod(httpget);
> 	  System.out.println(httpget.getResponseBodyAsString());
> 	} finally {
> 	  httpget.releaseConnection();
> 	}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message