[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SetError() #24: gsk_env_init: (GSKit) I/O: Unknown system state



   Follow up on "SetError() #24: gsk_env_init: (GSKit) I/O: Unknown
   system state".I was getting this error whenever I tried to access
   a secure Web Service (https).For a simple example of this look at
   EXAMPLE3 that is included with the download of Scott Klements
   HTTPAPI. Note: I don't think the URL included in EXAMPLE3 actually
   works any more. A member of another board supplied me with a
   different URL to use fortesting https: The actual code should
   look like this:
   H bnddir('HTTPAPI')
   /copy qrpglesrc,httpapi_h
   *
   D cmd           pr                          extpgm('QCMDEXC')
   D      cmd                   200a       const
   D     len                         15p 5   const
   *
   D rc                s              10i 0
   D app_id       s           100a
   *
   *-----------------------------------------------------------------*
   * BASIC SIMPLE USAGE:
   * Assuming the operating system has SSL installed and
   * configured the only requirement to use SSL with HTTPAPI is
   * that your URL must start with https: instead of http:
   *-----------------------------------------------------------------*
   *
   c       callp      http_debug(*on)
   c       eval       rc = http_url_get(
   c                      'https://www.fortify.net/sslcheck.html':
   c                      '/tmp/httptest.html')
   *
   c       if            rc <> 1
   c       callp     http_crash
   c       endif
   etc... there is more code in the EXAMPLE3, but the code you see
   above will suffice for my explanation.
   When I would debug the above code the variable rc would indeed
   not be equal to 1 (I can't remember the number...I think it was
   500) after the http_url_get. The callp http_crash would execute
   and I would get the "Unkown system state" error.
   The fix.
   I ended up calling IBM support and they were very helpful.
   To fix the problem we had to go into the Digital Certificate
   Manager on our IBMi.
   To do this...in my domain at least...I simply go to a Web
   Browser and enter  [1]http://your_system_name:2001/
   (You can use your system name or IP address).
   Enter a valid User ID and Password and click Log in.
   Click on the IBM i Tasks Page.
   Click on Digital Certificate Manager.
   Enter a User name & Password and click OK.
   Now you are in the Digital Certificate Manager.
   Click on Select a Certificate Store.
   Select *SYSTEM and click Continue.
   Enter the password and click Continue.
   All the options on the left will now refer to the
   *SYSTEM certificate Store.
   Click on Fast Path.
   Select Work with server and client certificates and
   click Continue.
   Note what the Default certificate label is.
   Select whatever your default certificate label is below
   and click Validate.
   If your default certificate in not valid, then you have a
   problem.
   You'll either have to renew your default certificate, or
   use a different one that is valid as your default.
   You can do your Renew of Set Default right from this screen.
   Please note that this is what fixed my problem.
   There may be other situations that cause the same, or similar
   errors that I had. This was just the fix in my case. I'm
   posting this in the hopes that it will maybe save someone
   else some grief.
   Thanks Paul.

References

   1. http://your_system_name:2001/
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------