我正在使用stunnel处理多个域证书。 我有两个域test.int和test1.int,并给每个域和一个默authentication书多个证书。 我使用stunnel的sni选项来提供多个域证书。 使用javascript的websocket我想连接到安全的服务器,但日志文件输出显示
SNI: extension not received from the client
所以我不确定sni选项支持与否。 有没有人能帮我解释一下它的工作与否? “SNI:从客户端收到的扩展名”语句的含义是什么?
在此先感谢您的宝贵答案。
我的stunnel.config文件
output=/var/log/stunnel.log pid= debug = 7 fips = no compression = rle options = NO_SSLv2 syslog = no [websockets] cert = /usr/local/etc/stunnel/default.crt key = /usr/local/etc/stunnel/default.key accept = 0.0.0.0:9443 connect = 127.0.0.1:9000 [sni1] sni = websockets:mailxf.test.int cert = /usr/local/etc/stunnel/test.int.crt key = /usr/local/etc/stunnel/test.int.key connect = 127.0.0.1:9000 [sni2] sni = websockets:mailxf.test1.int cert = /usr/local/etc/stunnel/test1.int.crt key = /usr/local/etc/stunnel/test1.int.key connect = 127.0.0.1:9000
日志文件输出
Service [websockets] accepted (FD=9) from 192.168.0.132:38257 2014.04.14 18:30:32 LOG7[7085:139648669734672]: Service [websockets] started 2014.04.14 18:30:32 LOG5[7085:139648669734672]: Service [websockets] accepted connection from 192.168.0.132:38257 2014.04.14 18:30:32 LOG7[7085:139648669734672]: SSL state (accept): before/accept initialization **2014.04.14 18:30:32 LOG5[7085:139648669734672]: SNI: extension not received from the client** 2014.04.14 18:30:32 LOG7[7085:139648669734672]: SSL state (accept): SSLv3 read client hello A 2014.04.14 18:30:32 LOG7[7085:139648669734672]: SSL state (accept): SSLv3 write server hello A 2014.04.14 18:30:32 LOG7[7085:139648669734672]: SSL state (accept): SSLv3 write change cipher spec A 2014.04.14 18:30:32 LOG7[7085:139648669734672]: SSL state (accept): SSLv3 write finished A 2014.04.14 18:30:32 LOG7[7085:139648669734672]: SSL state (accept): SSLv3 flush data 2014.04.14 18:30:32 LOG7[7085:139648669734672]: SSL state (accept): SSLv3 read finished A 2014.04.14 18:30:32 LOG7[7085:139648669734672]: 2 items in the session cache 2014.04.14 18:30:32 LOG7[7085:139648669734672]: 0 client connects (SSL_connect()) 2014.04.14 18:30:32 LOG7[7085:139648669734672]: 0 client connects that finished 2014.04.14 18:30:32 LOG7[7085:139648669734672]: 0 client renegotiations requested 2014.04.14 18:30:32 LOG7[7085:139648669734672]: 19 server connects (SSL_accept()) 2014.04.14 18:30:32 LOG7[7085:139648669734672]: 19 server connects that finished 2014.04.14 18:30:32 LOG7[7085:139648669734672]: 0 server renegotiations requested 2014.04.14 18:30:32 LOG7[7085:139648669734672]: 14 session cache hits 2014.04.14 18:30:32 LOG7[7085:139648669734672]: 0 external session cache hits 2014.04.14 18:30:32 LOG7[7085:139648669734672]: 0 session cache misses 2014.04.14 18:30:32 LOG7[7085:139648669734672]: 2 session cache timeouts 2014.04.14 18:30:32 LOG6[7085:139648669734672]: SSL accepted: previous session reused 2014.04.14 18:30:32 LOG6[7085:139648669734672]: connect_blocking: connecting 127.0.0.1:9000 2014.04.14 18:30:32 LOG7[7085:139648669734672]: connect_blocking: s_poll_wait 127.0.0.1:9000: waiting 10 seconds 2014.04.14 18:30:32 LOG5[7085:139648669734672]: connect_blocking: connected 127.0.0.1:9000 2014.04.14 18:30:32 LOG5[7085:139648669734672]: Service [websockets] connected remote server from 127.0.0.1:44325 2014.04.14 18:30:32 LOG7[7085:139648669734672]: Remote socket (FD=10) initialized
Javascript代码连接安全的服务器,
wss://mailxf.test.int:9443/bo/socket.bo.php
我使用的浏览器版本为Chrome 26和Firefox 24以及操作系统版本的centos 6。
您尝试直接连接到IP地址,而不是主机名。 所以SNI没有任何意义,因为你没有提供一个名字。 你打算使用主机名。
例如:
wss://example.com:9443/bo/socket.bo.php