1. When making an HTTPS request using the Yii 2 HTTP client extension, the following error occurred: “Curl error: #60 – SSL certificate problem: unable to get local issuer certificate”, as shown in Figure 1.

2. By configuring the client through the application component, I removed the ‘transport’ => ‘yii\httpclient\CurlTransport’ configuration option, as shown in Figure 2.

3. The Yii 2 HTTP client extension now makes HTTPS requests normally, as shown in Figure 3.

4. Checking the documentation at https://github.com/yiisoft/yii2-httpclient/blob/master/docs/guide-zh-CN/usage-transports.md reveals that CurlTransport supports advanced features like batch requests. Therefore, because batch requests are required, the client’s transport must be configured as CurlTransport, as shown in Figure 4.

5. I opened the URL https://curl.haxx.se/docs/caextract.html, downloaded and extracted cacert.pem (a clean file format/data), and copied it to C:\php-7.1.12\extras\ssl\cacert.pem, as shown in Figure 5.

6. I edited php.ini, changed ;curl.cainfo = to curl.cainfo = “C:\php-7.1.12\extras\ssl\cacert.pem”, and restarted PHP, as shown in Figure 6.

7. Because this is a RESTful application, Cookies are already disabled, so Cookies are only transmitted as request headers, as shown in Figure 7.

8. By configuring the client through the application component, I restored the ‘transport’ => ‘yii\httpclient\CurlTransport’ configuration option. The HTTPS request now works normally, as shown in Figure 8.

9. Checking the Debug log information shows that the Cookie settings are as expected, as shown in Figure 9.
Cookie: login_chinamcloud_id=13980074657; login_chinamcloud_tid=c7a8106ea2da1d5d5c01a13234c69ea8

