procedure TForm1.button1Click(Sender: TObject); //var //h: tIDhttp; //SSL: TIDSSliOHandlerSocketopenSSL;begin h.IOHandler := SSL; SSL.SSLOptions.Method := sslvTLSv1_2; SSL.sllOptions.SSLVersion := [sslvTLSv1_2]; //must be set automatically after SetMethod,but just to be sure h.Get('https://www.deviantart.com/users/login');end;
那个简单的代码给了我一个错误:
Error connecting with SSL.
error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure
我使用Delphi XE3和OpenSSL 1.0.2b库.
我无法弄明白,在查看消息来源时,连接启动中存在禁用未使用版本的字符串:
if not (sslvSSLv2 in SSLVersions) then begin SSL_CTX_set_options(fContext,SSL_OP_NO_SSLv2);end;if not (sslvSSLv3 in SSLVersions) then begin SSL_CTX_set_options(fContext,SSL_OP_NO_SSLv3);end;if not (sslvTLSv1 in SSLVersions) then begin SSL_CTX_set_options(fContext,SSL_OP_NO_TLSv1);end;
但sslv3的 *** 作仍然以某种方式进行.看起来不像组件的BUG.某个库内部,或者indy在设置参数时没有考虑到什么?
或者实际上是我,谁没有注意到重要的事情?
我真的希望我不需要经历一个名为“indy components update”的地狱.
测试(尝试所有方法,包括TLS1.2)https://www.deviantart.com/users/login
Resolving hostname www.deviantart.com.Connecting to 54.230.96.81.Handshake Start: before/connect initializationConnect Loop: before/connect initializationConnect Loop: SSLv3 write clIEnt hello Afatal Read Alert: handshake failureConnect Failed: SSLv3 read server hello AERROR: Error connecting with SSL.error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure
>对于SSL3和TLS1 / 1.1 / 1.2结果相同;
>对于SSLv23,回答SSL23_GET_SERVER_HELLO:sslv3警报握手失败;
>对于SSLv2没有回答;
对类似资源进行测试(仅限TLS1.2)https://files.yande.re/image/da9afa6d9ca43a9f154fad69f76adb85.jpg
Resolving hostname files.yande.re.Connecting to 5.39.10.56.Handshake Start: before/connect initializationConnect Loop: before/connect initializationConnect Loop: SSLv3 write clIEnt hello AConnect Loop: SSLv3 read server hello AConnect Loop: SSLv3 read server certificate AConnect Loop: SSLv3 read server key exchange AConnect Loop: SSLv3 read server done AConnect Loop: SSLv3 write clIEnt key exchange AConnect Loop: SSLv3 write change cipher spec AConnect Loop: SSLv3 write finished AConnect Loop: SSLv3 flush dataConnect Loop: SSLv3 read server session ticket AConnect Loop: SSLv3 read finished AHandshake Done: SSL negotiation finished successfullyConnect Exit: SSL negotiation finished successfully
我的WireShark测试:
> Indy:http://imgur.com/BZ84Cl3(响应是握手失败);
> firefox:http://imgur.com/pkYJvnO;
>对firefox请求的响应:http://imgur.com/M9ni3TV;
以上是内存溢出为你收集整理的delphi – tidhttp:奇怪的SSLv3_READ_BYTES错误(直接设置TLSv1_2连接)全部内容,希望文章能够帮你解决delphi – tidhttp:奇怪的SSLv3_READ_BYTES错误(直接设置TLSv1_2连接)所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)