SSLServerSocket을 사용하여 서버를 만들었습니다. 서버는 많은 다른 서버로부터 연결을받습니다. 다른 서버는 제 3 자의 서버입니다. 그 중 하나를 제외하고 항상 모든 서버에서 잘 작동합니다. 전형적인 SSL 디버그 로그는 다음과 같다 :TLS 연결에서 ServerHelloDone 뒤에 SocketTimeoutException이 발생했습니다.
WorkerThread-2, READ: Unknown-3.3 Handshake, length = 116
*** ClientHello, Unknown-3.3
RandomCookie: GMT: 1513485218 bytes = { 151, 69, 77, 255, 242, 138, 61, 245, 71, 237, 98, 49, 92, 122, 152, 21, 229, 164, 150, 171, 11, 177, 238, 234, 63, 168, 90, 151 }
Session ID: {}
Cipher Suites: [Unknown 0xc0:0x28, Unknown 0xc0:0x27, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, Unknown 0x0:0x3d, Unknown 0x0:0x3c, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA]
Compression Methods: { 0 }
Extension elliptic_curves, curve names: {secp384r1, secp256r1}
Extension ec_point_formats, formats: [uncompressed]
Unsupported extension signature_algorithms, data: 00:12:06:01:06:03:04:01:05:01:02:01:04:03:05:03:02:03:02:02
Unsupported extension type_35, data:
Unsupported extension type_23, data:
Extension renegotiation_info, renegotiated_connection: <empty>
***
%% Created: [Session-180, TLS_RSA_WITH_AES_128_CBC_SHA]
*** ServerHello, TLSv1
RandomCookie: GMT: 1513485220 bytes = { 74, 28, 71, 12, 232, 178, 237, 132, 60, 224, 123, 53, 189, 12, 182, 240, 206, 94, 159, 96, 89, 29, 71, 144, 161, 254, 84, 32 }
Session ID: {90, 54, 244, 164, 39, 152, 221, 223, 132, 77, 169, 99, 15, 202, 26, 191, 213, 70, 91, 125, 141, 91, 159, 248, 11, 145, 254, 187, 97, 178, 14, 233}
Cipher Suite: TLS_RSA_WITH_AES_128_CBC_SHA
Compression Method: 0
Extension renegotiation_info, renegotiated_connection: <empty>
***
Cipher suite: TLS_RSA_WITH_AES_128_CBC_SHA
*** Certificate chain
[... certificate chain follows ...]
***
*** CertificateRequest
Cert Types: RSA, DSS
Cert Authorities:
<CN=QuoVadis Root CA 2 G3, O=QuoVadis Limited, C=BM>
<CN=DigiCert Assured ID Root G3, OU=www.digicert.com, O=DigiCert Inc, C=US>
.... many more cert authorities
WorkerThread-2, WRITE: TLSv1 Handshake, length = 16384
*** ServerHelloDone
WorkerThread-2, WRITE: TLSv1 Handshake, length = 1403
WorkerThread-2, READ: TLSv1 Handshake, length = 3983
*** Certificate chain
chain [0] = [
... client certificate chain follows
...
... connection proceeds normally and suceeds
핸드 셰이크 정상 것 같습니다 당신이 볼 수 있듯이, 서버 인증서를 통해 인증하는 클라이언트가 요청하고 클라이언트로 보냅니다. 그러나, (나는에 액세스 할 수 없음) 타사 서버에 대해 하나,은 다음과 같은 핸드 쉐이크 진행 :
WorkerThread-2, READ: TLSv1 Handshake, length = 159
*** ClientHello, Unknown-3.3
RandomCookie: GMT: -750761141 bytes = { 238, 28, 230, 74, 9, 73, 28, 198, 222, 183, 234, 204, 37, 117, 50, 44, 71, 133, 93, 240, 66, 157, 241, 152, 75, 168, 0, 174 }
Session ID: {}
Cipher Suites: [Unknown 0xc0:0x2b, Unknown 0xc0:0x2f, Unknown 0xcc:0xa9, Unknown 0xcc:0xa8, Unknown 0xc0:0x2c, Unknown 0xc0:0x30, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, Unknown 0x0:0x9c, Unknown 0x0:0x9d, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA]
Compression Methods: { 0 }
Extension renegotiation_info, renegotiated_connection: <empty>
Unsupported extension server_name, [host_name: smtp3.myserverdns.com]
Unsupported extension type_23, data:
Unsupported extension type_35, data:
Unsupported extension signature_algorithms, data: 00:12:04:03:08:04:04:01:05:03:08:05:05:01:08:06:06:01:02:01
Extension ec_point_formats, formats: [uncompressed]
Extension elliptic_curves, curve names: {unknown curve 29, secp256r1, secp384r1}
***
%% Created: [Session-189, TLS_RSA_WITH_AES_128_CBC_SHA]
*** ServerHello, TLSv1
RandomCookie: GMT: 1513485240 bytes = { 91, 241, 167, 85, 144, 140, 202, 57, 192, 1, 43, 95, 77, 164, 68, 210, 170, 37, 114, 50, 237, 255, 17, 205, 131, 74, 242, 21 }
Session ID: {90, 54, 244, 184, 141, 168, 116, 151, 23, 155, 13, 108, 239, 23, 28, 117, 51, 182, 85, 174, 138, 132, 254, 29, 235, 231, 30, 184, 40, 27, 38, 145}
Cipher Suite: TLS_RSA_WITH_AES_128_CBC_SHA
Compression Method: 0
Extension renegotiation_info, renegotiated_connection: <empty>
***
Cipher suite: TLS_RSA_WITH_AES_128_CBC_SHA
*** Certificate chain
chain [0] = [
[
[... certificate chain follows ...]
***
*** CertificateRequest
Cert Types: RSA, DSS
Cert Authorities:
<CN=QuoVadis Root CA 2 G3, O=QuoVadis Limited, C=BM>
<CN=DigiCert Assured ID Root G3, OU=www.digicert.com, O=DigiCert Inc, C=US>
.... many more cert authorities
WorkerThread-2, WRITE: TLSv1 Handshake, length = 16384
*** ServerHelloDone
WorkerThread-2, WRITE: TLSv1 Handshake, length = 1403
WorkerThread-2, handling exception: java.net.SocketTimeoutException: Read timed out
WorkerThread-2, called close()
WorkerThread-2, called closeInternal(true)
WorkerThread-2, SEND TLSv1 ALERT: warning, description = close_notify
WorkerThread-2, WRITE: TLSv1 Alert, length = 2
WorkerThread-2, called close()
WorkerThread-2, called closeInternal(true)
WorkerThread-2, called close()
WorkerThread-2, called closeInternal(true)
당신이 볼 수 있듯이이 inmediately ServerHelloDone
후 클라이언트로부터 응답이 도착하지 않고 소켓 시간 초과가 발생합니다. 사실, 타임 아웃은 항상 1.5 초 밖에 걸리지 않습니다. 핸드 셰이크 시작 후.
이렇게 짧은 시간이 지난 후에 소켓 시간이 초과되는 이유는 무엇입니까? 나는 서버 hello의 어떤 것이 클라이언트에게는 좋지 않다고 생각하지만, 그것이 무엇인지에 대해서는 모른다. 오류를 정당화하는 두 개의 ssl 디버그 로그 사이에 중요한 차이점이 있습니까? 나는 운이없는 몇 시간 동안 인터넷에서 검색을 해왔다.
왜 1.5 초의 읽기 시간 초과를 설정하고 있습니까? – EJP
제한 시간 값을 설정하지 않고 있으며, 일반적으로 1.5 초 후에 시간 초과됩니다. 사용 된 시간 초과 값은 JVM 또는 시스템 기본값입니다. 이 문제는 한 클라이언트에서만 발생하며 모든 연결에서 구성이 동일하다는 점에 유의하십시오. – joanlofe
문자 그대로 메시지 접두어 만 포함하는 HelloDone은 아닙니다. 내가 생각할 수있는 모든 콘텐츠 관련 오류가 경고 또는 적어도 FIN 또는 RST를 생성해야하거나 처음 비행 자체 일 수는 있지만 고객이 응답하기 전에 모두 함께 전송되는 첫 번째 비행의 다른 것일 수 있습니다 . 가능한 경우 wireshark tcpdump 또는 유사한 방법으로 유선 추적을 가져 와서 첫 번째 비행에 대해 TCP 수준 확인을 받고 있는지 확인하십시오. 그렇다면 클라이언트 시스템을 보지 않고 진행할 수 없습니다. 클라이언트 시스템과 클라이언트 시스템 사이의 네트워크 경로를 살펴 보지 않으십시오. –