SendNetworkString over ssl?

Just starting out? Need help? Post your questions and find answers here.
User avatar
Brujah
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Nov 03, 2003 7:45 pm
Location: Germany
Contact:

SendNetworkString over ssl?

Post by Brujah »

I want to install a ssl certificate on my server.
Will there be problems with sending user highscores to it after that?

I initiate the connection like this:

Code: Select all

con = OpenNetworkConnection("www.lostlabyrinth.com", 80);
After that I send users highscores like this:

Code: Select all

SendNetworkString(con, "GET /newscore.php?" + p + " HTTP/1.1" + Chr(10))
SendNetworkString(con, "Host: www.lostlabyrinth.com" + Chr(10))
SendNetworkString(con, "User-agent: PureBasicAgent" + Chr(10))
SendNetworkString(con, "Accept: */*" + Chr(10))
SendNetworkString(con, Chr(10))
Will it be enough to change the port to 443?
infratec
Always Here
Always Here
Posts: 7577
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: SendNetworkString over ssl?

Post by infratec »

Since you are only using GET,
you can use ReceiveHTTPMemory().
Should work with http and https.

Code: Select all

URL$ = "https://www.lostlabyrinth.com/newscore.php?" + p

*Buffer = ReceiveHTTPMemory(URL$)
If *Buffer
  
  Debug PeekS(*Buffer, MemorySize(*Buffer), #PB_UTF8|#PB_ByteLength)
  
  FreeMemory(*Buffer)
EndIf
If you need POST ...
Then you need a more homebrewed version with imported libcurl stuff.

Bernd
User avatar
Brujah
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Nov 03, 2003 7:45 pm
Location: Germany
Contact:

Re: SendNetworkString over ssl?

Post by Brujah »

Get is enough.
But further thinking about it I guess it would be better to solve the problem on the server side.
Because otherwise players that use an older version of the game could not upload their scores anymore.

Guess its possible to tell the apache via htaccess it should handle one incoming url (newscore.php) different than all others.
Post Reply