php-openssl

Google Cloud SQL SSL fails peer certificate validation

孤街醉人 提交于 2019-12-19 10:04:52
问题 I have an issue using MySQL on PHP 5.6, and after three days of debugging PHP, OpenSSL, MySQLnd Drivers on PHP and trying out the mysql_client on an Ubuntu 14.04 machine, I have come to a conclusion: Google Cloud SQL SSL certificates will not work on PHP 5.6 and above. For a start, the Google Cloud is a great service, and modern cryptography is enforced throughout the Google ecosystem. However, I couldn't use it because of one little problem: Google Cloud SQL SSL Server certificates have

openssl_sign(): supplied key param cannot be coerced into a private key

Deadly 提交于 2019-12-13 04:25:26
问题 I have googled to search answer for these problem.but I'm not able to find proper solution for my question as many answer was specific to problem related. when I tried to create digital signature of content using XMLSecurityKey and openssl_sign I'm getting warning and signature was not created. openssl_sign is throwing error as : Warning: openssl_sign(): supplied key param cannot be coerced into a private key in /var/www/git/ta_client/accessService.php on line 105 And my code is: public

PHP - Openssl_decrypt error : wrong final block length (AES 256 CBC mode encryption/decryption)

荒凉一梦 提交于 2019-12-12 21:16:24
问题 This is my code : function decrypt($code) { $key = '3552ef55ecdf04324..'; // 64 bytes length $iv = 'd20818af907b59c3b15d258dd3969770'; // 32 bytes length $key = hash("sha256", $key,true); // 32 bytes length $iv = md5($iv,true); // 16 bytes length echo strlen(base64_decode($code)); // 80 bytes //return openssl_decrypt(base64_decode($code), 'aes-256-cbc', $key, 0 ,$iv); // return false $output = openssl_decrypt(base64_decode($code), 'aes-256-cbc', $key, 0 ,$iv); return openssl_error_string(); }

Slow performance when generating CloudFront Signed URLs

笑着哭i 提交于 2019-12-12 17:31:24
问题 I'm following this sample to create Signed URLs on CloudFront using PHP http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CreateURL_PHP.html And I have everything working fine and generating the Signed URLs for both RTMP Distributions and HTTP Distributions. However I noticed that generating the Sign URL takes quite some time and I wonder what impact could have when used in production with thousands of requests. I did some tests and it seems that the long time is taking is due

openssl_free_key expects parameter 1 to be resource

喜你入骨 提交于 2019-12-12 17:14:47
问题 I have this code: openssl_pkcs12_read($p12buf, $p12cert, $decPass); openssl_pkey_export($p12cert['pkey'], $pemkey); openssl_sign($toSign, $signature, $pemkey, OPENSSL_ALGO_SHA1); openssl_free_key($pemkey); I get this warning: Warning (2): openssl_free_key() expects parameter 1 to be resource, string given How can i get rid of it or what I am doing wrong? 回答1: openssl_free_key require the result (resource) of openssl_pkey_get_private or openssl_pkey_get_public $key = openssl_pkey_get_private(

PHP 7.1: no cURL with HTTP/2

亡梦爱人 提交于 2019-12-12 04:03:29
问题 My question is not about finding out if a server supports HTTP/2 (they both do) but how to make sure PHP is utilizing HTTP/2 with the correct cURL settings for the most current PHP version in CentOS (built from Remi's repository). My own answer addresses some oddities concerning this. I've setup my CentOS 7 server to support HTTP/2 with the help of this fine guide: Setting up HTTP/2 on your web server So I've got the latest releases, compiled and installed them and all is working fine. Pages

PHP why do I get errors regarding openssl?

为君一笑 提交于 2019-12-11 15:09:35
问题 Seems it is where PHP finishes... I mean the problem which I have faced with, is very deep in PHP. In PHP-CLI multithreaded script I get errors regarding openssl extension and they go deeply into libssl.so. It is segmentation fault, gdb bt doesn't show where it is coming from. In few words I created own php extension which is based on libssh2. The extension just opens tunnel to imap server via ssh. So then I can use in php the following script to communicate with imap via ssh: stream_socket

Test for OpenSSL enabled fails

不羁的心 提交于 2019-12-11 14:29:52
问题 I am testing if openssl is enabled and returns keys. Though openssl is enabled it is not returing keys. When tried to install the TYPO3 the error message is appearing. if (extension_loaded('openssl')) { $testKey = @openssl_pkey_new(); if (is_resource($testKey)) { } else { echo ' Please check the integration of the PHP OpenSSL extension and if it is installed correctly.'; } } Please help to continue installation. Thanks 回答1: Most likely the openssl.cnf file is not correctly configured or

Error signing pdf with PHP's openssl_pkcs7_sign

大城市里の小女人 提交于 2019-12-11 08:32:16
问题 I am using TCPDF to generate a pdf document and sign it. TCPDF itself just calls PHP's openssl_pkcs7_sign function, which seems to me to be calling C's PKCS7_sign function based on source code. Until recently things were working fine. Then I changed certificate provider. I just updated the private key, the certificate, and the certificate chain : $pdf->setSignature( $this->public_certificate_path, $this->private_key_path, $this->private_key_password, $this->extra_certificates_path, 1); I

PHP server side IAB verification openssl_verify always returns 0

我的未来我决定 提交于 2019-12-11 02:55:28
问题 I'm using the following function (server side php) to verify a IAB v3 transaction: I'm passing from the android app: @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { String signed_data=data.getStringExtra(IabHelper.RESPONSE_INAPP_PURCHASE_DATA); String signature=data.getStringExtra(IabHelper.RESPONSE_INAPP_SIGNATURE); I have a feeling it may have something to do with the signature I'm passing. I'm using the following Android method to encode it,