ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Does LIBHTTP support https?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Does LIBHTTP support https?

    I have been using Scott Klement's LIBHTTP with a web service. It's been working great.

    Last week, the web service informed me they were changing the protocol from http to https. I changed my RPG program & could no longer post. I just found out why. This is in HTTPAPIR4:

    Code:
    c                   if        peService<>'http'                      
    c                   callp     SetError(HTTP_BADURL:'Only the http ' +
    c                              'protocol is available!')             
    c                   return    -1                                     
    c                   endif
    So, can anyone here (maybe even Scott, if he's reading) tell me, is it really true that LIBHTTP doesn't support https?

    If not, does anybody know of an alternative I can use?

    TIA.

    Ted

  • #2
    Re: Does LIBHTTP support https?

    Update:

    I found some info about SSL at scottklment.com. Looks like I've got a little work to do.

    Comment


    • #3
      Re: Does LIBHTTP support https?

      Ted,

      FWIW, the product is called HTTPAPI. (LIBHTTP is the default for the name of the library to install it into, but you can install it in any library if you want.)

      I think perhaps you missed some of the code when you were diagnosing this. Here's that same code, but including some of the stuff that precedes it:
      Code:
        /if defined(HAVE_SSLAPI)                                              
       c                   if        peService<>'http' and peService<>'https' 
       c                   callp     SetError(HTTP_BADURL:'Only the http and'+
       c                              ' https protocols are available!')      
       c                   return    -1                                       
       c                   endif                                              
        /else                                                                 
       c                   if        peService<>'http'                        
       c                   callp     SetError(HTTP_BADURL:'Only the http ' +  
       c                              'protocol is available!')               
       c                   return    -1                                       
       c                   endif                                              
        /endif
      So... you can see that if this was compiled with HAVE_SSLAPI defined, then it allows both http and https. When not defined, then it only allows HTTP. At this time that this was released, it supported V4R2 and up, and V4R2 did not have support for SSL. Therefore, HTTPAPI asks during installation whether you'd like to compile support for SSL into HTTPAPI, and if you say Y=Yes, then it will define the HAVE_SSLAPI, and therefore include both http and https support. If you say N=No, then you'll only have HTTP support.

      In order for SSL support to work, you must also have the SSL support installed in the operating system. The README member that comes with HTTPAPI explains how that is done in the section titled 'REQUIREMENTS FOR BUILDING WITH SSL SUPPORT'.

      Comment


      • #4
        Re: Does LIBHTTP support https?

        Thanks, Scott. Evidently I did not opt to install SSL support when I ran the install program. I re-installed, recompiled my program to bind to the new definition, and that's taken care of.

        I have all of that software, so once I get the certificate squared away, maybe I will be in business.

        And I promise to do my utmost to call the software by its proper name. We elderly people have trouble with such things.

        Comment


        • #5
          Re: Does LIBHTTP support https?

          Who the hell did you just call OLD!!!!

          Enjoy your weekend.
          All my answers were extracted from the "Big Dummy's Guide to the As400"
          and I take no responsibility for any of them.

          www.code400.com

          Comment


          • #6
            Re: Does LIBHTTP support https?

            Originally posted by jamief View Post
            Who did you just call OLD?
            I only speak for myself. I'm also superannuated.

            Originally posted by jamief View Post
            Enjoy your weekend.
            You too. Looks like a lot of rotten weather for a lot of people.

            Comment

            Working...
            X