php - How to fix error:1408F10B:SSL routines:ssl3_get_record:wrong version number in guzzle 6 and laravel 5.7
问题描述
I want to get some data from the external API. I am using Guzzle 6 and Laravel 5.7 for doing this. But when I test it in postman, I got an error like this
GuzzleHttp\Exception\ConnectException: cURL error 35: error:1408F10B:SSL routines:ssl3_get_record:wrong version number
This is my code :
public function testapi(Request $request){
$xmlrequest = '<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:web="http://systemsunion.com/connect/webservices/">
<soapenv:Body>
<web:SecurityProviderAuthenticateRequest>
<web:name>username</web:name>
<web:password>password</web:password>
</web:SecurityProviderAuthenticateRequest>
</soapenv:Body>
</soapenv:Envelope>';
$action = 'SecurityProviderAuthenticateRequest';
$url = 'https://xx.xx.xx.xx:xxxx/services/Provider?wsdl';
$client = new Client();
$response = $client->post($url, [
'headers' => [
'SOAPAction' => $action, // Add the action
'Content-Type' => 'text/xml'
],
'body' => $xmlrequest
]);
if ($response) {
$res = $response->getBody()->getContents();
$doc = new \DOMDocument();
$doc->loadXML($res);
print_r($doc);
print_r($res);
exit();
}
}
How to fix this error?
解决方案
推荐阅读
- java - 如何在java中检查cassandra数据库表是否有数据
- ios - 直接点击按钮打开 DatePicker 弹出窗口
- azure - Microsoft Endpoint Manager (Intune) 中的重命名操作不起作用
- php - 将文件上传到 API 端点 Laravel
- elasticsearch - 在 Elasticsearch 中通过 API Rest 登录的应用程序的管理
- node.js - 在哪里保存通过 POST 上传的图像以及如何通过 GET 发送该图像
- php - 为什么 foreach 循环显示来自其他用户的数据?
- ldap - 用户是组成员时的 Ansible AWX LDAP 用户搜索问题
- php - 如何在 Laravel 8 中返回与模型实例的关系
- shell - SOCAT udp 流数据发送到文件,在该文件中查找模式并将有用的模式发送到 mosquitto 代理,然后清除该文件