测试ssl/tls版本支持时openssl实现的差异

测试ssl/tls版本支持时openssl实现的差异,openssl,Openssl,我正在尝试使用openssl测试tls/ssl版本支持。我看到3个不同版本的OpenSSL的结果有所不同 OpenSSL 1.0.1j 2014年10月15日:请注意,在这种情况下,我可以使用OpenSSL建立连接,甚至可以测试ssl2、tls1等。但以下输出仅在尝试测试ssl3时出现。所以,我无法理解这种行为 C:\Users\himanshu.agrawal>openssl s_client -connect facebook.com:443 -ssl3 WARNING: can't

我正在尝试使用
openssl
测试tls/ssl版本支持。我看到3个不同版本的OpenSSL的结果有所不同

OpenSSL 1.0.1j 2014年10月15日:请注意,在这种情况下,我可以使用OpenSSL建立连接,甚至可以测试ssl2、tls1等。但以下输出仅在尝试测试ssl3时出现。所以,我无法理解这种行为

C:\Users\himanshu.agrawal>openssl s_client -connect facebook.com:443 -ssl3
WARNING: can't open config file: /apache24/conf/openssl.cnf
unknown option -ssl3
usage: s_client args

 -host host     - use -connect instead
 -port port     - use -connect instead
 -connect host:port - who to connect to (default is localhost:4433)
 -verify arg   - turn on peer certificate verification
 -verify_return_error - return verification errors
 -cert arg     - certificate file to use, PEM format assumed
 -certform arg - certificate format (PEM or DER) PEM default
 -key arg      - Private key file to use, in cert file if
                 not specified but cert file is.
 -keyform arg  - key format (PEM or DER) PEM default
 -pass arg     - private key file pass phrase source
 -CApath arg   - PEM format directory of CA's
 -CAfile arg   - PEM format file of CA's
 -reconnect    - Drop and re-make the connection with the same Session-ID
 -pause        - sleep(1) after each read(2) and write(2) system call
 -prexit       - print session information even on connection failure
 -showcerts    - show all certificates in the chain
 -debug        - extra output
 -msg          - Show protocol messages
 -nbio_test    - more ssl protocol testing
 -state        - print the 'ssl' states
 -nbio         - Run with non-blocking IO
 -crlf         - convert LF from terminal into CRLF
 -quiet        - no s_client output
 -ign_eof      - ignore input eof (default when -quiet)
 -no_ign_eof   - don't ignore input eof
 -psk_identity arg - PSK identity
 -psk arg      - PSK in hex (without 0x)
 -srpuser user     - SRP authentification for 'user'
 -srppass arg      - password for 'user'
 -srp_lateuser     - SRP username into second ClientHello message
 -srp_moregroups   - Tolerate other than the known g N values.
 -srp_strength int - minimal mength in bits for N (default 1024).
 -ssl2         - just use SSLv2
 -ssl3         - just use SSLv3
 -tls1_2       - just use TLSv1.2
 -tls1_1       - just use TLSv1.1
 -tls1         - just use TLSv1
 -dtls1        - just use DTLSv1
 -fallback_scsv - send TLS_FALLBACK_SCSV
 -mtu          - set the link layer MTU
 -no_tls1_2/-no_tls1_1/-no_tls1/-no_ssl3/-no_ssl2 - turn off that protocol
 -bugs         - Switch on all SSL implementation bug workarounds
 -serverpref   - Use server's cipher preferences (only SSLv2)
 -cipher       - preferred cipher to use, use the 'openssl ciphers'
                 command to see what is available
 -starttls prot - use the STARTTLS command before starting TLS
                 for those protocols that support it, where
                 'prot' defines which one to assume.  Currently,
                 only "smtp", "pop3", "imap", "ftp" and "xmpp"
                 are supported.
 -engine id    - Initialise and use the specified engine
 -rand file;file;...
 -sess_out arg - file to write SSL session to
 -sess_in arg  - file to read SSL session from
 -servername host  - Set TLS extension servername in ClientHello
 -tlsextdebug      - hex dump of all TLS extensions received
 -status           - request certificate status from server
 -no_ticket        - disable use of RFC4507bis session tickets
 -nextprotoneg arg - enable NPN extension, considering named protocols supported (comma-separated list)
 -legacy_renegotiation - enable use of legacy renegotiation (dangerous)
 -use_srtp profiles - Offer SRTP key management with a colon-separated profile list
 -keymatexport label   - Export keying material using label
 -keymatexportlen len  - Export len bytes of keying material (default 20)
OpenSSL 1.0.2d 2015年7月9日

$ openssl s_client -connect facebook.com:443 -ssl3
CONNECTED(00000003)
2282780:error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:s3_pkt.c:1472:SSL alert number 40
2282780:error:1409E0E5:SSL routines:ssl3_write_bytes:ssl handshake failure:s3_pkt.c:656:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 7 bytes and written 0 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
    Protocol  : SSLv3
    Cipher    : 0000
    Session-ID:
    Session-ID-ctx:
    Master-Key:
    Key-Arg   : None
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    Start Time: 1449768766
    Timeout   : 7200 (sec)
    Verify return code: 0 (ok)
---
OpenSSL 0.9.8e-fips-rhel5 2008年7月1日: 我知道SSL3在Facebook中被禁用,但有趣的是,我正在建立SSL连接。但当我仔细观察时,我发现服务器证书是完全不同的。实际上,这次我在一个远程盒子上运行命令,这是一个私有网络,我使用VPN连接到它,然后执行openssl命令。可能与此有关


任何人都知道或看到了这些差异,尤其是前2个。

您的第一个测试无法连接,因为它不支持ssl3。未知选项-ssl3Stack Overflow是一个解决编程和开发问题的网站。这个问题似乎离题了,因为它与编程或开发无关。请参见帮助中心中的。也许或者会是一个更好的提问的地方。此外,SSLv3在测试后被所有人有效关闭。使用
-ssl3
选项几乎在任何地方都会失败,我应该在我的问题中提到,我正在尝试开发一个基于Java的SSL服务器调试器工具,在尝试通过Java编程使用openssl命令时遇到了诸如此类的问题,但我想直接命中目标,所以没有。@hagrawal-没问题。如果您接受了建议并访问了InfoSec.SE,您可能已经得到了问题的答案。网站的规则禁止我回答。您可能还需要查找“辩护”一词的定义。这不是对你的侮辱。