개발-IT/PHP

PHP 삽질노트

바다로그 2020. 11. 19. 15:57

#file_get_contents에서 HTTPS로 파일 로드 못할때

echo "<p>----------------------------------->";

$arrContextOptions=array(
    "ssl"=>array(
        "verify_peer"=>false,
        "verify_peer_name"=>false,
    ),
); 

$aws_cognito_iss_url='https://cognito-idp.eu-central-1.amazonaws.com/eu-central-1a/.well-known/jwks.json';
$jwks_json=file_get_contents($aws_cognito_iss_url,false, stream_context_create($arrContextOptions));
$JWKs=json_decode($jwks_json,true);
var_export( $JWKs);