ssl problem - fsockopen

The place for general PHP questions and hints for PHP on IBM i

Re: ssl problem - fsockopen

Postby deathcomp on Wed Apr 25, 2012 2:24 pm

So we have this same problem. We run this command it does fix it. However, one of our nightly jobs that runs undoes this somehow. As this job has over a hundred things it does, it's hard to pinpoint what's doing it.

So we thought we would just throw this command in a RPG program to run after the nightly job. It's not working and we aren't sure why. The joblog doesn't give an error it just says the QP2TERM was called with parms. Do we have something wrong?

Here is the RPG program:

Code: Select all
        *************** Beginning of data *******************************************************************************
0001.00 pgm                                                                                                      120417 
0002.00                                                                                                          120417 
0002.01      CALL PGM(QP2TERM) +                                                                                 120418 
0002.02        PARM('/usr/local/zendsvr/sbin/prngd'      +                                                       120418 
0002.03          '-s /usr/local/zendsvr/etc/prngd-seed'   +                                                      120419 
0002.04          '-p /usr/local/zendsvr/tmp/prngd.pid'    +                                                      120419 
0002.05          '-c /usr/local/ZendSvr/etc/prngd.conf'   +                                                      120419 
0002.06              '/etc/entropy &')                                                                           120419 
0002.07                                                                                                          120417 
0002.10 ENDTCPSVR  SERVER(*HTTP) HTTPSVR(ZENDSVR)                                                                120417 
0002.11 DLYJOB     DLY(5)                                                                                        120417 
0002.12 STRTCPSVR  SERVER(*HTTP) HTTPSVR(ZENDSVR)                                                                120417 
0002.13                                                                                                          120417 
0003.00 endpgm                                                                                                   120417 
deathcomp
 
Posts: 25
Joined: Mon Feb 13, 2012 5:17 pm

Re: ssl problem - fsockopen

Postby rodflohr on Tue Jun 26, 2012 7:27 pm

Instead of using a command, you can set up the PRNGD daemon to automatically start up with the Zend Server subsystem. Here is how to do it:

====== 5.6.0 and later

To automatically start the prngd server daemon (ZS_STR_PRN job) when the ZENDSVR subsystem is started, please make sure ZENDSVR is in your library list, and then run this command:

ZSAUTOJOB

This command displays the following screen:

Automatic job start (ZSAUTOJOB)

Type choices, press Enter.

Monitor daemon (Y/N) . . . . . . > Y
Java Bridge daemon (Y/N) . . . . > N
Job Queue daemon (Y/N) . . . . . > Y
Deployment daemon (Y/N) . . . . > Y
Prngd daemon (Y/N) . . . . . . . > N

Change the Prngd daemon flag to 'Y'. Press enter for changes to take effect.

====== Prior to 5.6.0

To automatically start the prngd server daemon (ZS_STR_PRN job) whenever the ZENDSVR subsystem is started, prompt (F4) this command (library ZENDSVR should be in your library list):

ZSAUTOJOB

When prompted, this command displays the following screen:

Automatic job start (ZSAUTOJOB)

Type choices, press Enter.

Monitor daemon (Y/N) . . . . . . Y
Java Bridge daemon (Y/N) . . . . N
Job Queue daemon (Y/N) . . . . . Y
PHP Toolkit service (Y/N) . . . Y
Prngd daemon (Y/N) . . . . . . . N

Change the Prngd daemon flag to 'Y'. Press enter for the change to take effect. Please note that the screen always shows default settings, so you must remember to flag all of the services that you want to autostart (this is no longer a problem starting with version 5.6.0).
User avatar
rodflohr
 
Posts: 43
Joined: Mon Dec 29, 2008 5:28 pm

Re: ssl problem - fsockopen

Postby deathcomp on Wed Jun 27, 2012 12:56 pm

I changed the prngd daemon to start is Y and restarted the subsystem and I still got the error. I had to run the command again manually.

[27-Jun-2012 07:51:42] PHP Warning: SoapClient::SoapClient() [<a href='soapclient.soapclient'>soapclient.soapclient</a>]: SSL operation failed with code 1. OpenSSL Error messages:
error:24064064:random number generator:SSLEAY_RAND_BYTES:PRNG not seeded in /www/zendsvr/htdocs/development/soap/soapqc3.php on line 35
[27-Jun-2012 07:51:42] PHP Warning: SoapClient::SoapClient() [<a href='soapclient.soapclient'>soapclient.soapclient</a>]: Failed to enable crypto in /www/zendsvr/htdocs/development/soap/soapqc3.php on line 35
[27-Jun-2012 07:51:42] PHP Warning: SoapClient::SoapClient(https://qhos.qualcommapps.com/qhoswsna/driver.asmx?WSDL) [<a href='soapclient.soapclient'>soapclient.soapclient</a>]: failed to open stream: operation failed in /www/zendsvr/htdocs/development/soap/soapqc3.php on line 35
[27-Jun-2012 07:51:42] PHP Warning: SoapClient::SoapClient() [<a href='soapclient.soapclient'>soapclient.soapclient</a>]: I/O warning : failed to load external entity &quot;https://qhos.qualcommapps.com/qhoswsna/driver.asmx?WSDL&quot; in /www/zendsvr/htdocs/development/soap/soapqc3.php on line 35
[27-Jun-2012 07:51:42] PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://qhos.qualcommapps.com/qhoswsna/driver.asmx?WSDL' : failed to load external entity "https://qhos.qualcommapps.com/qhoswsna/driver.asmx?WSDL"
in /www/zendsvr/htdocs/development/soap/soapqc3.php on line 35
deathcomp
 
Posts: 25
Joined: Mon Feb 13, 2012 5:17 pm

Previous

Return to PHP Questions / Hints

Who is online

Users browsing this forum: No registered users and 1 guest