0
0

More than 3 years have passed since last update.

java でAPI呼ぶ時にjavax.net.ssl.SSLHandshakeException発生すること

Posted at

だれか答えたらありがたいです

       URL url = new URL("https://xxxxRequest");
HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
conn.setDoOutput(true);
conn.setDoInput(true);
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/json; charset=utf-8 ");
//some headers and params
OutputStreamWriter os = new OutputStreamWriter(conn.getOutputStream());
os.write(json.toString());
os.flush();
conn.connect();
recode = conn.getResponseCode();

エラーメッセージ
javax.net.ssl.SSLHandshakeException: Failed to negotiate the use of secure renegotiation
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1946)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:316)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:306)
at sun.security.ssl.ClientHandshaker.serverHello(ClientHandshaker.java:513)
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:207)
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1037)
at sun.security.ssl.Handshaker.process_record(Handshaker.java:965)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1064)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1367)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1395)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1379)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0