15 file_get_contents SSL エラー

開発環境で自己署名しているhttps環境において、file_get_contentsすると、

Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in xxxxx

というエラーが表示されます。

対策

$url = "https://xxxxxx";
$options['ssl']['verify_peer']=false;
$options['ssl']['verify_peer_name']=false;
$response = file_get_contents($url, false, stream_context_create($options));