File tree 2 files changed +4
-9
lines changed
2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ class ClientFactory
8
8
public static function buildCurlClient (
9
9
int $ connectionTimeOut = 10 ,
10
10
int $ requestTimeOut = 100 ,
11
- bool $ isVerify = true
11
+ bool $ isVerify = false
12
12
) {
13
13
$ client = new HttpCurlClient ();
14
14
$ client ->setVerifySSL ($ isVerify );
@@ -19,7 +19,7 @@ public static function buildCurlClient(
19
19
public static function buildGuzzleClient (
20
20
int $ connectionTimeOut = 10 ,
21
21
int $ requestTimeOut = 100 ,
22
- bool $ isVerify = true
22
+ bool $ isVerify = false
23
23
) {
24
24
$ client = new GuzzleClient ();
25
25
$ client ->setVerifySSL ($ isVerify );
Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ private function prepare(RequestInterface $request) : void
115
115
} else {
116
116
$ this ->baseCurl ->setupOption (CURLOPT_CUSTOMREQUEST , $ request ->getMethod ());
117
117
}
118
+ $ this ->baseCurl ->setupOption (CURLOPT_SSL_VERIFYPEER , true );
118
119
if ($ this ->isVerifySSL ) {
119
120
$ this ->setSSLConfig ();
120
121
} else {
@@ -145,19 +146,13 @@ private function setPostBodyAndMethod(RequestInterface $request)
145
146
146
147
private function setSSLConfig ()
147
148
{
148
- $ tlsVersion = $ this ->baseCurl ->versionOfTLS ();
149
- $ versions = ['TLS 1.2 ' , 'TLS 1.3 ' ];
150
- if (!in_array ($ tlsVersion , $ versions )) {
151
- throw new \RuntimeException ("Error. Checking TLS 1.2/1.3 version failed. Please make sure your PHP cURL supports TSL 1.2/1.3 " );
152
- }
153
- $ this ->baseCurl ->setupOption (CURLOPT_SSL_VERIFYPEER , true );
154
149
$ this ->baseCurl ->setupOption (CURLOPT_SSL_VERIFYHOST , 2 );
155
150
$ this ->baseCurl ->setupOption (CURLOPT_CAINFO , CoreConstants::getCertPath ());
156
151
}
157
152
158
153
private function acceptAll ()
159
154
{
160
- $ this ->baseCurl ->setupOption (CURLOPT_SSL_VERIFYPEER , false );
155
+ $ this ->baseCurl ->setupOption (CURLOPT_SSL_VERIFYHOST , 0 );
161
156
}
162
157
163
158
private function updateCurlSettings ()
You can’t perform that action at this time.
0 commit comments