HTTPSecureSocket.Secure

Excuse me, but why on earth does the HTTPSecureSocket.Secure default to false? If I wanted http and not https then I would use HTTPSocket. This is as dumb as Timers and Buttons adding to the project without an Action event already there, we have to waste our time adding the event. In this case we waste our time setting a property to true that should be true already.

So fine, I make my own subclass of this object which sets the property to true in the constructor. But really, why should I have to do this?

Because it was made in 1998.

Use Xojo.Net.HTTPSocket, it handles things you’re going to need if you’re dealing with a modern API.

Edit: FWIW you can make control defaults by doing some voodoo with templates or something in a subfolder of Documents. IMO this feature was a bodged rush-job so I’m waiting for it to be implemented properly. It’s hard to use so I don’t recall the instructions, you’d have to find those (or Paul might know them).

For what you want to do make a one line file called HTTPSecureSocket.defaults and save it in one of the two locations noted in the page linked below. In the file put:

HTTPSecureSocket.Secure=true

http://developer.xojo.com/override-system-class-default-values

Thanks, I didn’t know about that. Seems very useful. I only worry that I would forget to copy the folder or files over to any Xojo installation I’m working on, so for now I’ll stick to my subclass. But it’s good to know this exists.

I have a small app which can read this file from this link :
https://throb.pagesperso-orange.fr/prg/SuppXplane/scenery_packs_Model01.ini
or this file from this link :
http://tom.25.free.fr/prg/SuppXplane/scenery_packs_Model01.ini

“pagesperso-orange” was http until next week but now Orange host is https. Then I change my HTTPSocket to HTTPSecureSocket and I put MySocket.Secure to true if I read from https and false if I read from http . It works well to read https (with secure = True) but I can’t read http (with secure = false).
My workarround is to use HTTPSocket to read from http and HTTPSecureSocket for https. Then I have 2 Sockets.

But I wonder what this MySocket.Secure is for, as if I put it to false it doesn’t work ?

I’m still learning this myself but from what I can gather, HTTPSecureSocket was replaced by Xojo.Net.HTTPSocket… which was in turn replaced with URLConnection. Perhaps that is what you should be using?