Skip to content

Instantly share code, notes, and snippets.

@jirisolc
Last active October 14, 2023 18:44
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jirisolc/a5644ff4fdd7a6476235 to your computer and use it in GitHub Desktop.
Save jirisolc/a5644ff4fdd7a6476235 to your computer and use it in GitHub Desktop.
PHP fopen() to https:// without cert check
<?php
$context = stream_context_create(
array (
'ssl' = > array (
'verify_peer' => false,
'verify_peer_name' => false
)
)
);
$f= fopen("https://somesite.foo/url", "rb", false, $context);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment