0
.cert 형식의 인증서 4 개를 제공 한 회사의 웹 서비스에 연결하려고합니다.이 인증서를 키 저장소에 저장하고 Https를 연결하여 클라이언트 코드인증서가 필요한 웹 서비스에 연결할 때 오류가 발생했습니다.
System.setProperty("javax.net.ssl.trustStore",ERPGetProperty.erpGetProperty("pathToKeyStore"));
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
System.setProperty("javax.net.ssl.trustStoreType", "JKS");
System.setProperty("javax.net.ssl.keyStore", ERPGetProperty.erpGetProperty("pathToKeyStore"));
System.setProperty("javax.net.ssl.keyStorePassword", "changeit");
System.setProperty("javax.net.ssl.keyStoreType", "JKS");
System.setProperty("https.protocols", "TLSv1.2");
SSLSocketFactory sslSocketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
URL url = new URL(address);
HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
con.setSSLSocketFactory(sslSocketFactory);
con.setRequestMethod("POST");
con.setUseCaches(true);
con.setRequestProperty("Content-type", "text/xml");
con.setRequestProperty("Content-Length", Integer.toString(xml.length()));
con.setRequestProperty("SOAPAction", address);
con.setDoOutput(true);
con.setDoInput(true);
userPass = username + ":" + password;
byte[] encodeBytes = Base64.encodeBase64(userPass.getBytes());
String encode = new String(encodeBytes);
con.setRequestProperty("Authorization", "Basic " + encode);
out = con.getOutputStream();
out.write(b);
난 항상이 예외
10:21:15,591 ERROR [stderr] (DefaultQuartzScheduler_Worker-2) java.net.ConnectException: Operation timed out
10:21:15,591 ERROR [stderr] (DefaultQuartzScheduler_Worker-2) at java.net.PlainSocketImpl.socketConnect(Native Method)
10:21:15,591 ERROR [stderr] (DefaultQuartzScheduler_Worker-2) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
10:21:15,592 ERROR [stderr] (DefaultQuartzScheduler_Worker-2) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
10:21:15,592 ERROR [stderr] (DefaultQuartzScheduler_Worker-2) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
10:21:15,593 ERROR [stderr] (DefaultQuartzScheduler_Worker-2) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
10:21:15,593 ERROR [stderr] (DefaultQuartzScheduler_Worker-2) at java.net.Socket.connect(Socket.java:579)
10:21:15,593 ERROR [stderr] (DefaultQuartzScheduler_Worker-2) at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:618)
10:21:15,594 ERROR [stderr] (DefaultQuartzScheduler_Worker-2) at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:160)
10:21:15,594 ERROR [stderr] (DefaultQuartzScheduler_Worker-2) at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
10:21:15,594 ERROR [stderr] (DefaultQuartzScheduler_Worker-2) at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
10:21:15,595 ERROR [stderr] (DefaultQuartzScheduler_Worker-2) at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
10:21:15,595 ERROR [stderr] (DefaultQuartzScheduler_Worker-2) at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:275)
10:21:15,595 ERROR [stderr] (DefaultQuartzScheduler_Worker-2) at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:371)
10:21:15,596 ERROR [stderr] (DefaultQuartzScheduler_Worker-2) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
10:21:15,596 ERROR [stderr] (DefaultQuartzScheduler_Worker-2) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:932)
10:21:15,596 ERROR [stderr] (DefaultQuartzScheduler_Worker-2) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
10:21:15,597 ERROR [stderr] (DefaultQuartzScheduler_Worker-2) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1091)
10:21:15,597 ERROR [stderr] (DefaultQuartzScheduler_Worker-2) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
10:21:15,598 ERROR [stderr] (DefaultQuartzScheduler_Worker-2) at hot.com.mhd.erp.action.client.PushStatusClient.pushXML(PushStatusClient.java:492)
10:21:15,598 ERROR [stderr] (DefaultQuartzScheduler_Worker-2) at main.com.mhd.erp.sched.StatusPushJob.execute(StatusPushJob.java:73)
10:21:15,598 ERROR [stderr] (DefaultQuartzScheduler_Worker-2) at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
10:21:15,599 ERROR [stderr] (DefaultQuartzScheduler_Worker-2) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
을 얻을 그리고는이 예외가 발생하기 전에 내가 디버그 모드에서 무엇을 얻을의 일부입니다
10:21:00,034 INFO [stdout] (DefaultQuartzScheduler_Worker-4) Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
10:21:00,034 INFO [stdout] (DefaultQuartzScheduler_Worker-4) Ignoring unavailable cipher suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA
10:21:00,035 INFO [stdout] (DefaultQuartzScheduler_Worker-4) Ignoring unavailable cipher suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
10:21:00,035 INFO [stdout] (DefaultQuartzScheduler_Worker-4) Ignoring unsupported cipher suite: TLS_DHE_DSS_WITH_AES_128_CBC_SHA256
10:21:00,036 INFO [stdout] (DefaultQuartzScheduler_Worker-4) Ignoring unsupported cipher suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA256
10:21:00,036 INFO [stdout] (DefaultQuartzScheduler_Worker-4) Ignoring unsupported cipher suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
10:21:00,036 INFO [stdout] (DefaultQuartzScheduler_Worker-4) Ignoring unsupported cipher suite: TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
10:21:00,036 INFO [stdout] (DefaultQuartzScheduler_Worker-4) Ignoring unsupported cipher suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
10:21:00,037 INFO [stdout] (DefaultQuartzScheduler_Worker-4) Ignoring unsupported cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
10:21:00,037 INFO [stdout] (DefaultQuartzScheduler_Worker-4) Ignoring unsupported cipher suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
10:21:00,037 INFO [stdout] (DefaultQuartzScheduler_Worker-4) Ignoring unsupported cipher suite: TLS_RSA_WITH_AES_256_CBC_SHA256
10:21:00,037 INFO [stdout] (DefaultQuartzScheduler_Worker-4) Ignoring unavailable cipher suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
10:21:00,038 INFO [stdout] (DefaultQuartzScheduler_Worker-4) Ignoring unsupported cipher suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
10:21:00,038 INFO [stdout] (DefaultQuartzScheduler_Worker-4) Ignoring unsupported cipher suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
10:21:00,038 INFO [stdout] (DefaultQuartzScheduler_Worker-4) Ignoring unavailable cipher suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA
10:21:00,038 INFO [stdout] (DefaultQuartzScheduler_Worker-4) Ignoring unsupported cipher suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
10:21:00,039 INFO [stdout] (DefaultQuartzScheduler_Worker-4) Ignoring unsupported cipher suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
10:21:00,039 INFO [stdout] (DefaultQuartzScheduler_Worker-4) Ignoring unsupported cipher suite: TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
10:21:00,039 INFO [stdout] (DefaultQuartzScheduler_Worker-4) Ignoring unavailable cipher suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
10:21:00,039 INFO [stdout] (DefaultQuartzScheduler_Worker-4) Ignoring unavailable cipher suite: TLS_RSA_WITH_AES_256_CBC_SHA
10:21:00,040 INFO [stdout] (DefaultQuartzScheduler_Worker-4) Ignoring unsupported cipher suite: TLS_RSA_WITH_AES_128_CBC_SHA256
도와주세요! 이 문제를 해결하기 위해 시간이 없습니다! 고맙습니다!
응답 해 주셔서 감사합니다. 그렇다면 예외가 올바르게 설정되지 않은 인증서와 아무런 관련이 없음을 의미합니다. 그것들은 모두 .cer 포맷으로되어 있으며, 키 도구를 사용하여 키 도구를 사용하여 가져 왔으며 패스워드와 함께 System 속성으로 패스를 지정했습니다. 회사는 서버가 가동 중이라고합니다. 아마도 암호 모음에 대한 이러한 오류로 인해 문제가 발생했을 수 있습니다. Mac OS 10.10을 사용하고 있습니다. 나와 서버 사이에 방화벽이없는 것을 어떻게 확인할 수 있습니까? 많은 질문에 대해 유감스럽게 생각하지만 나는 이것으로 아주 새롭다. 다시 한 번 감사드립니다! –
다른 클라이언트와 확인하십시오. 실패 할 경우 방화벽이나 서버 자체입니다. 이 경우 가능한 한 서버 근처에서 다른 위치에서 확인하십시오. 서버가 방금 설정 되었으면 사이트에서 올바르게 테스트하는 것을 잊어 버린 것일 수도 있습니다. –