mirror of https://github.com/shred/acme4j
Lets Encrypt SSLSocketFactory is a singleton
parent
dba96d0531
commit
afaf286a49
|
@ -37,7 +37,7 @@ import org.shredzone.acme4j.connector.HttpConnector;
|
||||||
*/
|
*/
|
||||||
public class LetsEncryptHttpConnector extends HttpConnector {
|
public class LetsEncryptHttpConnector extends HttpConnector {
|
||||||
|
|
||||||
private SSLSocketFactory sslSocketFactory;
|
private static SSLSocketFactory sslSocketFactory;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpURLConnection openConnection(URI uri) throws IOException {
|
public HttpURLConnection openConnection(URI uri) throws IOException {
|
||||||
|
@ -52,7 +52,7 @@ public class LetsEncryptHttpConnector extends HttpConnector {
|
||||||
* Lazily creates an {@link SSLSocketFactory} that exclusively accepts the Let's
|
* Lazily creates an {@link SSLSocketFactory} that exclusively accepts the Let's
|
||||||
* Encrypt certificate.
|
* Encrypt certificate.
|
||||||
*/
|
*/
|
||||||
protected SSLSocketFactory createSocketFactory() throws IOException {
|
protected synchronized SSLSocketFactory createSocketFactory() throws IOException {
|
||||||
if (sslSocketFactory == null) {
|
if (sslSocketFactory == null) {
|
||||||
try {
|
try {
|
||||||
KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());
|
KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());
|
||||||
|
|
Loading…
Reference in New Issue