Alpha Video Training
Results 1 to 8 of 8

Thread: POST or GET via SSL

  1. #1
    Member
    Real Name
    Geoff Caplan
    Join Date
    May 2001
    Posts
    66

    Default POST or GET via SSL

    I need to transfer some data securely to a remote web application. The obvious way would be to use HTTPS POST, or, less conveniently, HTTPS GET.

    According to the docs, http_get_page2 should work with HTTPS urls. It works fine with HTTP, but when I run it with HTTPS Alpha hangs and has to be be killed.

    According to someone in the archives, http_post_page2 should also work with HTTPS, but when I try this I get the error:

    ERROR: OLE Automation Error. Source is msxml3.dll."Unspecified error"

    In their marketing, Alpha make great play of A5s internet capabilities. Surely this should include basic access to HTTPS?? Any suggestions?

    I'm running the latest build on XP. I do a lot of internet programming on this machine in other languages without problems - so I suspect the issue is with A5.

  2. #2
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,696

    Default RE: POST or GET via SSL

    Geoff,

    Both http_get_page2() and http_post_page2() support SSL. They have been tested with a number of SSL servers and I am aware of many users using them successfully with SSL servers within their applications.

    If you can post with the specifics of how you are using http_post_page2() and http_get_page2(), we can help you track this problem down.

    -Lenny

  3. #3
    Member
    Real Name
    Geoff Caplan
    Join Date
    May 2001
    Posts
    66

    Default RE: POST or GET via SSL

    Lenny -

    Here's the session in the interactive shell:

    """""""""""""""""""""
    dim body as c
    dim response as p
    body = "test=foobar"

    response = http_post_page2("https://dev.creativeliving.co.uk/backoffice-user-account", body)

    ERROR: OLE Automation Error. Source is msxml3.dll."Unspecified error"
    """""""""""""""""""""

    The URL above should echo back the content of post variable "test"

  4. #4
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,696

    Default RE: POST or GET via SSL

    For starters, the documentation for http_post_page2() is incorrect, response needs to be dimmed as C. It will contain the body of the response, similar to http_get_page2().

    Once you change that, you will see that the request still returns just an empty string. This is because the SSL certificate being used by that server belongs to www.jivadacards.co.uk so a trusted encrypted connection cannot be established.

    -Lenny

  5. #5
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,696

    Default RE: POST or GET via SSL

    I've done a bit more research on this problem. Both http_get_page2() and http_post_page2() use a Microsoft component, IXMLHTTPRequest.

    When using this object for a POST where the certificate does not match, the object aborts the connection.

    When using this object for a GET where the certificate does not match, the object pts up a dialog box prompting the user to accept or reject the certificate. The interactive window cannot show this dialog, but if you do the http_get_page2() from a script, you will see the dialog come up and ask what you'd like to do.

    If you want to use a POST, you'll have to have the server administrator update the SSL certificate. If you want to use GET, it will work fine from a script.

    -Lenny

  6. #6
    Member
    Real Name
    Geoff Caplan
    Join Date
    May 2001
    Posts
    66

    Default RE: POST or GET via SSL

    Lenny

    Many thanks for all your input.

    The live site will have a correct certificate, of course, but the development site has a bodged certificate (too expensive to install an authenticated cert for all the different staging versions) This has never been a problem before.

    I'll set up a self-signed cert and see if the dll will work with that. Otherwise, I'll have to develop this feature on the live site..

  7. #7
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,696

    Default RE: POST or GET via SSL

    Geoff, try the following:


    dim url as c
    dim body as c
    url = "https://dev.creativeliving.co.uk/backoffice-user-account"
    body = "test=foobar"

    obj = ole.create("Msxml2.SERVERXMLHTTP")
    obj.setoption(2,13056) 'ignore SSL errors
    obj.open("POST", url, .f.)
    obj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
    obj.send(body)
    ?obj.responseText

  8. #8
    Volunteer Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,842

    Default Re: POST or GET via SSL

    Does http_post_page2() work with SSL or not???

    There are what seem to be conflicting message here, http_post_pages2() works with SSL, but here are all these ActiveX settings suggested to make it work. I cannot make it work given the following. I am running this from a Server with a valid SSL certificate and running Alpha Five Application Server/8.0 1759-3105.

    bdy = "test"
    url = "https://ssl.selectpayment.com/rtg/XMLGateway.aspx"
    dim cc as c
    cc = http_post_page2(url,bdy)
    ?if(cc="","cc is blank","cc is not blank: " + cc)

    The IF statement always returns that cc is not blank, but has no content.


    I have tried every other example on the forum including the examples in this thread.
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    There is no Cloud. It's just someone else's computer.
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

Similar Threads

  1. Looking for old post
    By Scott Emerick in forum Alpha Five Version 5
    Replies: 2
    Last Post: 03-21-2004, 04:20 AM
  2. field rule post vs. <tbl>.post()
    By tcampb in forum Alpha Five Version 4
    Replies: 8
    Last Post: 10-22-2003, 11:17 PM
  3. Help using <tbl>.post()
    By Graham Wickens in forum Alpha Five Version 4
    Replies: 3
    Last Post: 10-09-2002, 06:21 PM
  4. Sorry for last bug post.
    By Jamin Dunivan in forum Alpha Five Version 4
    Replies: 6
    Last Post: 08-24-2001, 11:26 AM
  5. I can't get it to post
    By lake trash in forum Alpha Five Version 4
    Replies: 3
    Last Post: 02-15-2001, 06:54 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •