hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (HTTPCLIENT-1434) TrustSelfSignedStrategy should be a singleton
Date Wed, 04 Jun 2014 12:23:01 GMT

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

Oleg Kalnichevski resolved HTTPCLIENT-1434.
-------------------------------------------

    Resolution: Fixed

Done in SVN trunk.

Oleg

> TrustSelfSignedStrategy should be a singleton
> ---------------------------------------------
>
>                 Key: HTTPCLIENT-1434
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1434
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.3.1
>            Reporter: Sebastiano Vigna
>            Priority: Trivial
>             Fix For: 4.4 Alpha1
>
>
> TrustSelfSignedStrategy should be a singleton, as it happens for several other strategies
in HTTP Client. For example, 
> public class TrustSelfSignedStrategy implements TrustStrategy {
>    public static final TrustSelfSignedStrategy INSTANCE = new TrustSelfSignedStrategy();
>    private TrustSelfSignedStrategy() {}
>     public boolean isTrusted(
>             final X509Certificate[] chain, final String authType) throws CertificateException
{
>         return chain.length == 1;
>     }
> }
> Incidentally, I noted that other strategies (e.g., NoConnectionReuseStrategy) have a
public constructor, which violates the Singleton design pattern.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

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


Mime
View raw message