PHP OpenSSL fsockopen -> SSLSocket

Hello,

I am using a webserver based on XOJO.
As xojo-example I have the project:
Xojo/Communication/Internet/Web Server/WebServer.xojo_binary_project as base code.

So far, so good, I have problems with the SSLSocket which I use instead of TCPSocket.
The web server runs perfectly local behind a router.

https://xxx Calls with browser work flawlessly

I also access the local server with PHP and fsockopen.
This only works with SSLSocket.Secure=false.

If Secure=true SSLSocket refuses to cooperate and reports error code 102 "LostConnection. The OpenSSL fsockopen simply reports back (0),
if it is addressed with ssl://myxojoserver
But a PHP fsockopen test on example.com via ssl://example.com works.

My ADDsocket looks like this:

// Create a new HTTPConnection socket
// to pass back to the server
Dim s As New HttpConnection

if(s.LastErrorCode = 0) then
if(NI0net = true) then
s.NetworkInterface = System.GetNetworkInterface(NI0) // default = 0
elseif(NI1net = true) then
s.NetworkInterface = System.GetNetworkInterface(NI1) // default = 0
end if
if ( SecureJAMOSERV = true ) then
s.Secure = true
s.ConnectionType = SSLSocket.TLSv12
Dim jazertifikat As FolderItem = iServerFiles.Child(“jaddjaentwicklung.local.crt”)
If jazertifikat <> Nil Then
s.CertificateFile = jazertifikat
End If
end if
// Be sure to set it’s root directory
// so that it can serve the pages correctly
s.RootDir = rootDir
// Hand it back to the server
Return s
end if

Anybody got any ideas?

Does fsockopen open a TLS connection directly, or does it open a TCP connection and then negotiate an upgrade to TLS? If it’s trying to upgrade then this is a known bug with the ServerSocket: <https://xojo.com/issue/49500>