hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simone Tripodi (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HTTPCLIENT-1752) Allow to configure the OSGI clients with relaxed SSL checks
Date Thu, 21 Jul 2016 09:00:29 GMT

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

Simone Tripodi updated HTTPCLIENT-1752:
---------------------------------------
    Attachment: HTTPCLIENT-1752_initial.patch

[~olegk] I kindly ask you to have a look at the initial work I've been doing on that, please
mind it is just the start and it is not intended to be committed.

Like for the {{org.apache.hc.client5.http.osgi.services.ProxyConfiguration}}, I added a {{org.apache.hc.client5.http.osgi.services.TrustedHostsConfiguration}}
to handle relaxed SSL checks, then a {{org.apache.hc.client5.http.osgi.impl.RelaxedLayeredConnectionSocketFactory}}
should do the leg work, questions are:

 * is it correct the {{RelaxedLayeredConnectionSocketFactory}} implementation? Not being an
SSL expert I guess it is ok but maybe I overlooked few details;
 * how to wire the {{RelaxedLayeredConnectionSocketFactory}} to the created instances? I noticed
a lot of work is done in the {{HttpProxyConfigurationActivator}} which evolved from wiring
just the proxy configuration, do you have a suggestion?

Many thanks in advance!
/CC [~marett]

> Allow to configure the OSGI clients with relaxed SSL checks
> -----------------------------------------------------------
>
>                 Key: HTTPCLIENT-1752
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1752
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>          Components: HttpClient
>    Affects Versions: 4.5.2
>            Reporter: Timothee Maret
>             Fix For: Future
>
>         Attachments: HTTPCLIENT-1752_initial.patch
>
>
> In deployments other than production (e.g. dev, qa, integration testing, etc.) it is
often useful to deploy self-signed certificates instead of certificates signed by a trusted
CA for cost and simplicity reasons.
> By default, the http client does not validate a self signed certificate because it is
not signed by a trusted CA root. 
> One way to have the http client to validate the self signed certificate is to add the
self-signed certificate (or the detached CA root that signed it) in the java trustore.
> This operation is a configuration only change (no need to change code) however it typically
requires accessing the FS and the scope of trust can't be easily modified at runtime.
> Another way to have the http client to validate the self signed certificate is to use
the TrustSelfSignedStrategy [0] strategy when building the http client.
> This requires modifying the code.
> In order to use the second approach without modifying code, it would be interesting to
allow configuring a set of URIs for which the relaxed SSL mode should be used.
> The configuration could be implemented similarly to the implementation of the central
prox configuration (OSGI) in HTTPCLIENT-1238. In addition to allowing sel-signed certificates,
the configuration could as well allow to skip FQDN check using the NoopHostnameVerifier [1].
> Of course, this feature *must not* be deployed in production environment as it is totally
insecure.
> [0] https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/conn/ssl/TrustSelfSignedStrategy.html
> [1] https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/conn/ssl/NoopHostnameVerifier.html



--
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