File tree Expand file tree Collapse file tree 1 file changed +4
-22
lines changed
src/main/java/wtx/woocommerce/api/client/invoker Expand file tree Collapse file tree 1 file changed +4
-22
lines changed Original file line number Diff line number Diff line change @@ -1498,28 +1498,10 @@ private void applySslSettings() {
14981498 TrustManager [] trustManagers ;
14991499 HostnameVerifier hostnameVerifier ;
15001500 if (!verifyingSsl ) {
1501- trustManagers = new TrustManager []{
1502- new X509TrustManager () {
1503- @ Override
1504- public void checkClientTrusted (java .security .cert .X509Certificate [] chain , String authType ) throws CertificateException {
1505- }
1506-
1507- @ Override
1508- public void checkServerTrusted (java .security .cert .X509Certificate [] chain , String authType ) throws CertificateException {
1509- }
1510-
1511- @ Override
1512- public java .security .cert .X509Certificate [] getAcceptedIssuers () {
1513- return new java .security .cert .X509Certificate []{};
1514- }
1515- }
1516- };
1517- hostnameVerifier = new HostnameVerifier () {
1518- @ Override
1519- public boolean verify (String hostname , SSLSession session ) {
1520- return true ;
1521- }
1522- };
1501+ TrustManagerFactory trustManagerFactory = TrustManagerFactory .getInstance (TrustManagerFactory .getDefaultAlgorithm ());
1502+ trustManagerFactory .init ((KeyStore ) null );
1503+ trustManagers = trustManagerFactory .getTrustManagers ();
1504+ hostnameVerifier = OkHostnameVerifier .INSTANCE ;
15231505 } else {
15241506 TrustManagerFactory trustManagerFactory = TrustManagerFactory .getInstance (TrustManagerFactory .getDefaultAlgorithm ());
15251507
You can’t perform that action at this time.
0 commit comments