#1 2024-09-29 01:05:15

allanbrrj
Member
Registered: 2021-11-23
Posts: 2

HTTPS on THttpAsyncServer

Hi, I'm starting with mormort.

When try use https, InitNetTlsContextSelfSignedServer or InitNetTlsContext,  returning this error on every request.

Exception class ESChannel with message '<>: HandshakeStep returned 80090331 [SEC_E_ALGORITHM_MISMATCH], System Error 1 [ERROR_INVALID_FUNCTION]'.
Exception class ESChannel with message '<>: HandshakeStep returned 80090327 [SEC_E_CERT_UNKNOWN], System Error 87 [ERROR_INVALID_PARAMETER]'.

I dont undestand where put this code "InitNetTlsContextSelfSignedServer" or "InitNetTlsContext".

I using Server.WaitStarted(10,@FCertificado) but always return erro on request.

I tried use certificate .crt, .pem, .pfx evething return same error, this certicates dont installed on windows.

this is my code.

ab edit: moved to gist

Offline

#2 2024-09-29 01:41:33

allanbrrj
Member
Registered: 2021-11-23
Posts: 2

Re: HTTPS on THttpAsyncServer

I correct my code and now everything is ok.

ab edit: moved to gist

Offline

#3 2024-09-29 10:48:05

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,552
Website

Re: HTTPS on THttpAsyncServer

Hello smile

Please follow the forum rules and don't put code directly in the forum, but in a gist.
wink

So, to sumup, now your HTTPS server is working as expected, with the code of your last post?

Edit:
I have created a gist to show you how it works, and taken the liberty to remove the source code from your posts.
https://gist.github.com/synopse/fe1ba20 … e910a4e75c
And you can easily show diffs between versions, so  it is easy to see what you did to make it work in your 2nd revision:
https://gist.github.com/synopse/fe1ba20 … /revisions

Offline

Board footer

Powered by FluxBB