2

I have configure the pear config-set http_proxy "$http_proxy", but this not have any effect.

Take a look below to see what is the output I'm getting:

pecl install bz2
WARNING: "pear/bz2" is deprecated in favor of "channel://http://php.net/bzip2/ext/bz2"

Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in PEAR/Proxy.php on line 101

Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /usr/local/lib/php/PEAR/Proxy.php on line 101

Notice: Undefined variable: proxy_host in PEAR/Proxy.php on line 103

Notice: Undefined variable: proxy_port in PEAR/Proxy.php on line 103

Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in PEAR/Proxy.php on line 101

Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /usr/local/lib/php/PEAR/Proxy.php on line 101

Notice: Undefined variable: proxy_host in PEAR/Proxy.php on line 103

Notice: Undefined variable: proxy_port in PEAR/Proxy.php on line 103
Could not establish SSL connection through proxy ::
Mark Han
  • 2,785
  • 2
  • 16
  • 31
Bruno Wego
  • 2,099
  • 3
  • 21
  • 38
  • I tried use `openssl.cafile` with `/etc/ssl/certs/cacert.pem`. Again, no effect. – Bruno Wego Jan 20 '20 at 22:37
  • Relation with https://stackoverflow.com/questions/2266491/how-to-use-pear-behind-proxy/5939452, but not solve my issue. – Bruno Wego Jan 20 '20 at 22:49
  • Does this answer your question? [How to use PEAR behind proxy?](https://stackoverflow.com/questions/2266491/how-to-use-pear-behind-proxy) – Mark Han Jan 21 '20 at 01:46
  • proxy_host looks to be undefined... I would asked questions in comments of the related issue. – Mark Han Jan 21 '20 at 01:47
  • @MarkHan I tried it before, but without success. Thanks. – Bruno Wego Jan 21 '20 at 10:24
  • which php and pear version are you using? – cweiske Jan 21 '20 at 13:10
  • Tried with PHP version 7.0.33 and PEAR version 1.10.5. – Bruno Wego Jan 21 '20 at 13:58
  • I sort of solved it by emptying it since I had that missing var error message conversely with a configured proxy, but it was configured in docker not in the host so it was undesired maybe causing problems - https://askubuntu.com/questions/465198/how-do-i-temporarily-remove-proxy-settings/465199#465199 . – FantomX1 Aug 11 '22 at 13:45

2 Answers2

0

I had the same problem.

I solved this by adding the below to php.ini and all the errors went away.

openssl.cafile=/etc/ssl/certs/ca-bundle.trust.crt
Joshua
  • 1,128
  • 3
  • 17
  • 31
0

I solved the issue by adding those lines to the PEAR/Proxy.php file after the line: stream_context_set_option($fp, 'ssl', 'peer_name', $host );

stream_context_set_option($fp, 'ssl', 'verify_peer', False );
stream_context_set_option($fp, 'ssl', 'verify_peer_name', False );
stream_context_set_option($fp, 'ssl', 'allow_self_signed', True );

It's an ugly hack but works for me !

Miogi
  • 13
  • 3