Commit 7700a15d authored by Quxl's avatar Quxl

x

parent 844954fc
...@@ -10,7 +10,7 @@ import org.springframework.context.ApplicationContext; ...@@ -10,7 +10,7 @@ import org.springframework.context.ApplicationContext;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
import com.egolm.sso.util.MyTrustManager; import com.egolm.sso.util.SAPTrustManager;
@EnableScheduling @EnableScheduling
@SpringBootApplication @SpringBootApplication
...@@ -21,7 +21,7 @@ public class SapServiceApplication { ...@@ -21,7 +21,7 @@ public class SapServiceApplication {
public static void main(String[] args) throws KeyManagementException, NoSuchAlgorithmException { public static void main(String[] args) throws KeyManagementException, NoSuchAlgorithmException {
TimeZone.setDefault(TimeZone.getTimeZone("GMT+8")); TimeZone.setDefault(TimeZone.getTimeZone("GMT+8"));
MyTrustManager.trustAllHttpsCertificates(); SAPTrustManager.trustAllHttpsCertificates();
applicationContext = SpringApplication.run(SapServiceApplication.class, args); applicationContext = SpringApplication.run(SapServiceApplication.class, args);
} }
......
...@@ -10,13 +10,13 @@ import javax.net.ssl.SSLSession; ...@@ -10,13 +10,13 @@ import javax.net.ssl.SSLSession;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
public class MyTrustManager implements javax.net.ssl.TrustManager, javax.net.ssl.X509TrustManager { public class SAPTrustManager implements javax.net.ssl.TrustManager, javax.net.ssl.X509TrustManager {
private final static Log logger = LogFactory.getLog(MyTrustManager.class); private final static Log logger = LogFactory.getLog(SAPTrustManager.class);
public static void trustAllHttpsCertificates() throws NoSuchAlgorithmException, KeyManagementException { public static void trustAllHttpsCertificates() throws NoSuchAlgorithmException, KeyManagementException {
javax.net.ssl.TrustManager[] trustAllCerts = new javax.net.ssl.TrustManager[1]; javax.net.ssl.TrustManager[] trustAllCerts = new javax.net.ssl.TrustManager[1];
javax.net.ssl.TrustManager tm = new MyTrustManager(); javax.net.ssl.TrustManager tm = new SAPTrustManager();
trustAllCerts[0] = tm; trustAllCerts[0] = tm;
javax.net.ssl.SSLContext sc = javax.net.ssl.SSLContext.getInstance("SSL"); javax.net.ssl.SSLContext sc = javax.net.ssl.SSLContext.getInstance("SSL");
sc.init(null, trustAllCerts, null); sc.init(null, trustAllCerts, null);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment