본문 바로가기
이과/laravel 자료

cURL error 60: SSL certificate problem 에러

by 코딩초밥 2023. 10. 18.
반응형
 
cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.ht

...


뭐 이런 에러가나오는데

ssl 인증서를 검사했는데 안나와서 연결이 잘안된다는 그런 뜻이다

 

혹시 laravel 에서 get 이나 post api 를 보내는 데 이 에러 가 계속 뜬다면 

withOptions 함수를 사용해 보자

 

예제, 

 $streamId = $request->input('streamId');
    $streamName = $request->input('streamName');

    $url = 'www.example.com'
    $response = Http::withOptions([
        'Content-Type' => 'application/json',
        'verify' => false, // SSL 인증서 검증 비활성화
        'headers' => [
            'Accept' => 'application/json',
        ],
    ])->post($url, [
        'streamId' => $streamId,
        'name' => $streamName,
    ]);
반응형

댓글