|
<< Click to Display Table of Contents >> Navigation: Telegram > 2022 > 01 > 16 > Telegram_2022-01-16T14 |
2022-01-16T14:11:36
If you are switching to HTTPS in the middle of a session, then calling the method SwitchToSecure() will do it, as proposed by José Nilton above.
If you are wondering how to make your whole application start using HTTPS instead of HTTP, then you must:
1- Get a self-signed development certificate. You will need a *real* certificate when deploying it to the real server. See how here: type: link https://www.atozed.com/intraweb/certmanager/creating-and-installing-self-signed-development-certificates-for-http-sys-applications/
2- Turn on HTTPS in your application. This is done as soon as you set the SSLOptions.Port property. The default HTTPS value is 443 (it may conflict with other software in your machine though, especially IIS. If that's the case, you can turn off IIS while developing).
If your certificate has a password, set it via SSLOptions.Certificate.Password property.
3- Set SSLOpitons.NonSSLRequest to nsRedirect (your application will only accept HTTPS from now on)
There are some demos in our github repository that show this process
2022-01-16T14:21:15
Please notice that only steps 1 and 2 in the link above are needed for Indy. There are other steps in the document that are intended for Http.sys deployment only (not Indy)