blitzbasic

Author Topic: SSL using SOCK_TCPCONNECT  (Read 525 times)

Offline Chris

  • Mc. Print
  • *
  • Posts: 5
    • View Profile
SSL using SOCK_TCPCONNECT
« on: 2010-Sep-16 »
I'm trying to connect to a SOAP endpoint with SSL

    server$ = "api.betfair.com/global/v3/BFGlobalService"
    port%=443

    SOCK_INIT()

    sock% = SOCK_TCPCONNECT(server$, port%)

Everytime I try I get a -1 returned after about 5 seconds (which I guess is the timeout).

Any ideas?

Am I going about this the wrong way?

Thinking about this a little more...

What I think I need is the counterpart to NETWEBGET
Something like a NETWEBSET  (which doesn't exist in GLBASIC.... yet)

NETWEBSET("https://api.betfair.com/global/v3/BFGlobalService", 443,  "myxml")

Is there any equivalent, or am I going to have to do something "fruity" in C?

Thanks for any help in this... (hoping).
« Last Edit: 2010-Sep-17 by Chris »

Offline Chris

  • Mc. Print
  • *
  • Posts: 5
    • View Profile
Re: SSL using SOCK_TCPCONNECT
« Reply #1 on: 2010-Sep-18 »
For anyone who's interested.

I used wireshark to sniff the packets, and it looks like SOCK_TCPCONNECT does NOT do any kind of SSL handling.  It just treats the port 443 as it would do for any other port.

If I needed to write a game that had secure TCP communication how would I go about doing this?

I would be grateful if anyone has any ideas.

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *****
  • Posts: 10277
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: SSL using SOCK_TCPCONNECT
« Reply #2 on: 2010-Sep-30 »
No, I don't use SSL sockets. I might have to add a command to do that. Not sure if all platforms will support that.

Offline Chris

  • Mc. Print
  • *
  • Posts: 5
    • View Profile
Re: SSL using SOCK_TCPCONNECT
« Reply #3 on: 2012-Apr-11 »
Any Chance SSL could be added?  I bought GLBASIC some time ago, and its languished unused... This single feature would mean I would definitely use it.

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *****
  • Posts: 10277
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: SSL using SOCK_TCPCONNECT
« Reply #4 on: 2012-Apr-11 »
I see if I can get it working. Might not be too hard. You want true sockets, or just curl?

Offline kanonet

  • Prof. Inline
  • *****
  • Posts: 587
    • View Profile
    • My GLBasic code archiv
Re: SSL using SOCK_TCPCONNECT
« Reply #5 on: 2012-Apr-12 »
I would like to get this too! But about your question, i dont know, would cURL be able to connect to a 3rd party server, that dont uses cURL, but "real" secure sockets?
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *****
  • Posts: 10277
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: SSL using SOCK_TCPCONNECT
« Reply #6 on: 2012-Apr-12 »
most stuff (dropbox...) uses curl. It's as if you type it in a browser. If, however, you want direct socket support to send raw tcp data, then something else has to be used.

Offline kanonet

  • Prof. Inline
  • *****
  • Posts: 587
    • View Profile
    • My GLBasic code archiv
Re: SSL using SOCK_TCPCONNECT
« Reply #7 on: 2012-Apr-12 »
I think for me cURL will be all i need, but i dont know for others.
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

Offline Chris

  • Mc. Print
  • *
  • Posts: 5
    • View Profile
Re: SSL using SOCK_TCPCONNECT
« Reply #8 on: 2012-May-01 »
Sorry for the late reply... curl would probably do it for me.  :)
Just some way of doing standard protocols, nothing super low level is needed.

Thanks.
C.