Код: Выделить всё
ssl_context = ssl.create_default_context()
ssl_context.check_hostname = False
ssl_context.verify_mode = ssl.CERT_NONE
ws_connection_local = connect(f"wss://{target_ip}:{WEBSOCKET_SSL_PORT}", ssl_context=ssl_context)
Код: Выделить всё
CountDownLatch latch = new CountDownLatch(1);
String url = "wss://$host:$port"
WebSocket ws = HttpClient
.newHttpClient()
.newWebSocketBuilder()
.buildAsync(URI.create(url), new WebSocketClient(latch))
Код: Выделить всё
java.util.concurrent.CompletionException: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
и установите доверие ко всем сертификатам с рекомендуемыми неактивными HttpsURLConnection.setDefaultSSLSocketFactory и т. д., а также HttpsURLConnection.setDefaultHostnameVerifier и т. д. Однако это не помогло, я получаю ту же ошибку. Я также установил точки останова отладчика в TrustManager и HostnameVerifier, чтобы увидеть, были ли они вызваны, а они нет.
Подробнее здесь: https://stackoverflow.com/questions/792 ... de-to-java
Мобильная версия