I currently have OpenSSL configured in XAMPP on Windows. Following this , I tried using the following code:
$privateKey = openssl_pkey_new(array( 'private_key_bits' => 1024, 'private_key_type' => OPENSSL_KEYTYPE_RSA, )); openssl_pkey_export_to_file($privateKey, 'private.key'); $a_key = openssl_pkey_get_details($privateKey); file_put_contents('public.key', $a_key['key']); openssl_free_key($privateKey);
When I open the page, I get the error "Webpage Unavailable." I managed to identify the problem before openssl_pkey_get_details() , because if I delete this, the page will load successfully. In addition, private.key is generated without problems in the first part of the code. Any help would be appreciated.
source share