본문 바로가기
기타/PHP

cURL error 60: SSL certificate

by 죠부니 2022. 11. 25.
반응형

https://stackoverflow.com/questions/29822686/curl-error-60-ssl-certificate-unable-to-get-local-issuer-certificate

 

cURL error 60: SSL certificate: unable to get local issuer certificate

I am trying to send an API request using Stripe but get the error message: cURL error 60: SSL certificate problem: unable to get local issuer certificate This is the code I am running: public fun...

stackoverflow.com

==

윈도우로 PHH서버를 돌리고있었다.

https://curl.se/docs/caextract.html

 

curl - Extract CA Certs from Mozilla

CA certificates extracted from Mozilla The Mozilla CA certificate store in PEM format (around 200KB uncompressed): cacert.pem This bundle was generated at Tue Oct 11 03:12:05 2022 GMT . This PEM file contains the datestamp of the conversion and we only mak

curl.se

위의 사이트에서 cacert.pem파일을 다운로드 받는다

pem파일 위치는 적당히 알아서 잘맞춰준다.

사용중인 PHP의 php.ini 파일을 열어서 수정한다.

curl.cainfo 부분과 openssl.cafile 부분이 주석쳐진부분이 보일것이다.

[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
curl.cainfo =C:\Apache24\conf\cacert.pem

[openssl]
; The location of a Certificate Authority (CA) file on the local filesystem
; to use when verifying the identity of SSL/TLS peers. Most users should
; not specify a value for this directive as PHP will attempt to use the
; OS-managed cert stores in its absence. If specified, this value may still
; be overridden on a per-stream basis via the "cafile" SSL stream context
; option.
openssl.cafile=C:\Apache24\conf\cacert.pem

해당부분을 다운로드받은 cacert.pem파일 경로를 맞춘다.

 

반응형

'기타 > PHP' 카테고리의 다른 글

There is no active transaction  (0) 2022.10.26
'' // "" // 따옴표처리  (0) 2020.03.31
fcm  (0) 2019.09.10
curl  (0) 2019.09.10
implode,explode  (0) 2019.06.20