B4J Library HTTPUlils 2 and SSL

Discussion in 'B4J Libraries & Classes' started by swissmade, May 15, 2015.

  1. swissmade

    swissmade Active Member Licensed User

    Hi all,
    For my one needs I have change HTTPUtils to use SSL.
    I like to share this if somebody need this.
    Now you can use True or False to make use of SSL.
    Code:
    Job.Initialize("yourJobName", Me, True)
    I have built this from HttpUtils2 Source 1.02 1.03 Source I don't have.
    Version will be 1.04.
    I hope somebody like this.
     

    Attached Files:

    inakigarm likes this.
  2. Erel

    Erel Administrator Staff Member Licensed User

    You don't need to change anything in order to use SSL.

    Just pass a https url instead of http.
     
  3. swissmade

    swissmade Active Member Licensed User

    Oh,

    Then I miss something.
    This was the only way to download some files from the server.
    I have a Https link and I always get Refused when I try to download.
    Will try again
     
    Last edited: May 15, 2015
  4. swissmade

    swissmade Active Member Licensed User

    Is the
    Is there an other Jhttputils2 then 10.3
    I always get this on a https URL

    Error: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
     
    Last edited: Jun 16, 2015
  5. Erel

    Erel Administrator Staff Member Licensed User

    You are probably connecting to a server that uses a self signed certificate. So you need to call the somewhat dangerous method hc.InitializeAcceptAll.
    If your server used a known certificate then it would have worked with no changes.

    I think that you should describe the change you did in the first post.
     
  6. swissmade

    swissmade Active Member Licensed User

    Yes I use this and know its better for not. But I need to test this.
    I have not find the way to create a Trusted certificate yet without spending money on this only for testing and maybe later use it.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice