问题描述
在通过REST调用使用GuzzleHttp客户端设置简单的登录测试时,我遇到了一些困难。我在网上四处张望,但不幸的是没有成功,所以我想知道这里是否有人可以提供帮助。
我正在Debian 9服务器上使用最新的laravel。
这是我的代码:
use GuzzleHttp\Client as HttpClient;
$response = Http::withOptions(['debug' => true,])
->withHeaders([
'cert' => Storage::get('dss/mTLS.crt'),'ssl_key' => Storage::get('dss/privateKey.pem'),'Content-Type' => 'application/json;charset=utf-8','X-CSRF-TOKEN' => session()->token(),])
->post('https://emea.api.hvca.globalsign.com:8443/v2/login',[
'api_key' => env('DSS_API_KEY'),'api_secret' => env('DSS_API_SECRET'),'curl' => array(
'CURLOPT_SSLVERSION' => 'CURL_SSLVERSION_TLSv1','CURLOPT_SSL_CIPHER_LIST' => 'SSLv2','CURLOPT_CAINFO' => '/etc/ssl/certs/ca-certificates.crt',),]);
dd($response);
如您所见,这是一个简单的请求,我为SSL版本尝试了v1,v2和v3,结果相同:
调试结果:
Trying 185.140.80.38... * TCP_NODELAY set * Connected to emea.api.hvca.globalsign.com (185.140.80.38) port 8443 (#0) * ALPN,offering http/1.1 * Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH * successfully set certificate verify locations: * CAfile: /etc/ssl/certs/ca-certificates.crt CApath: /etc/ssl/certs * error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure * Curl_http_done: called premature == 1 * stopped the pause stream! * Closing connection 0
Exception: Illuminate\Http\Client\ConnectionException cURL error 35: error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)
任何帮助将不胜感激:-)
谢谢。
欢呼
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)