gpt4 book ai didi

php - Guzzle (35) gnutls_handshake() 失败 : An unexpected TLS packet was received over HTTP

转载 作者:行者123 更新时间:2023-12-04 19:10:25 27 4
gpt4 key购买 nike

我从我的服务器向其他服务器(http://example.com:8180)发送 api 请求
我得到这个错误

"cURL error 35: gnutls_handshake() failed : An unexpected TLS packet was received."



奇怪的是,当我在本地和舞台服务器上测试它时
没有问题。
生产服务器和舞台服务器的区别在于ssl的存在。
但是这可能是问题吗?

我有点相信这是关于“php curl”的,因为 guzzle 在代码中不起作用,但 curl on command 可以
我在代码中使用 curl 没有 guzzle 但仍然没有工作。
我设置 CURLOPT_SSL_VERIFYPEERCURLOPT_SSL_VERIFYHOST错误但仍然没有工作。
只要我知道 SSL 无关紧要,因为我尝试通过 HTTP 连接到服务器,对吗?

下面是我编译的php,curl,服务器信息
PHP Version => 7.2.1

System => Linux ip-x-x-x-x 4.4.0-1060-aws #69-Ubuntu SMP Sun May 20 13:42:07 UTC 2018 x86_64
Build Date => Jan 31 2019 05:39:24
Configure Command => './configure' '--enable-fpm' '--with-openssl' '--with-pdo-mysql' '--enable-mbstring' '--with-libxml-dir' '--enable-intl' '--with-gettext' '--with-mhash' '--with-gd' '--with-pc
re-jit' '--with-zlib' '--enable-bcmath' '--enable-calendar' '--with-zlib-dir' '--with-curl' '--enable-zip'

curl

cURL support => enabled
cURL Information => 7.47.0
Age => 3
Features
AsynchDNS => Yes
CharConv => No
Debug => No
GSS-Negotiate => No
IDN => Yes
IPv6 => Yes
krb4 => No
Largefile => Yes
libz => Yes
NTLM => Yes
NTLMWB => Yes
SPNEGO => Yes
SSL => Yes
SSPI => No
TLS-SRP => Yes
HTTP2 => No
GSSAPI => Yes
KERBEROS5 => Yes
UNIX_SOCKETS => Yes
PSL => No
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtmp, rtsp, smb, smbs, smtp, smtps, telnet, tftp
Host => x86_64-pc-linux-gnu
SSL Version => GnuTLS/3.4.10
ZLib Version => 1.2.8
echo | openssl s_client -connect x.x.x.x:8180
CONNECTED(00000003)
139662896404120:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:794:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 7 bytes and written 305 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.2
Cipher : 0000
Session-ID:
Session-ID-ctx:
Master-Key:
Key-Arg : None
PSK identity: None
PSK identity hint: None
SRP username: None
Start Time: 1560955018
Timeout : 300 (sec)
Verify return code: 0 (ok)
---

最佳答案

问题已经解决了。

我使用 laravel 并且有一个黑盒是 route() helper functiong
它根据服务器配置设置 url http 或 https
并且生产服务器设置为 https

这就是它导致错误的原因。

关于php - Guzzle (35) gnutls_handshake() 失败 : An unexpected TLS packet was received over HTTP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56672701/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com