So here is the problem after we have requested SSL certificate, we cannot use http anymore (must use https). If I try to use http I will get the following error:
For scripting, the reason why I use http (not https), because directadmin recommends to use non-ssl in this documentation (see the bold part): https://www.directadmin.com/api.php
" ... DirectAdmin Uses port 2222 which may or may not be secure (SSL). The default is not, so if you need to chose one, chose non SSL. .."
The second reason for using http is, you probably understand because after directadmin installation, it does not automatically request SSL certificate for host domain (server.test.com) for us. If we try to use API with https, on the host server without SSL (server.test.com), then we will still got error.
I consider this might be 99% bug in API because directadmin should not force https when the http is available to use. Even this documentation said about this here : https://www.directadmin.com/features.php?id=1022
"... since the API usually isn't worried about valid certificates."
For your information I don't even have this setting enabled (even I have it, directadmin said this won't affect the API call)
@smtalk
Now, I'm not sure if I have to write a script to handle whether the host domain is SSL ready then use https, else use http. Or I need to wait for the bug fixed? Thanks
Is there any environment variable that directadmin store to tell that the host domain is https ready ?
Code:
<script>location.protocol = "https:";</script></html>
For scripting, the reason why I use http (not https), because directadmin recommends to use non-ssl in this documentation (see the bold part): https://www.directadmin.com/api.php
" ... DirectAdmin Uses port 2222 which may or may not be secure (SSL). The default is not, so if you need to chose one, chose non SSL. .."
The second reason for using http is, you probably understand because after directadmin installation, it does not automatically request SSL certificate for host domain (server.test.com) for us. If we try to use API with https, on the host server without SSL (server.test.com), then we will still got error.
I consider this might be 99% bug in API because directadmin should not force https when the http is available to use. Even this documentation said about this here : https://www.directadmin.com/features.php?id=1022
"... since the API usually isn't worried about valid certificates."
For your information I don't even have this setting enabled (even I have it, directadmin said this won't affect the API call)
Code:
force_hostname=server.test.com
@smtalk
Now, I'm not sure if I have to write a script to handle whether the host domain is SSL ready then use https, else use http. Or I need to wait for the bug fixed? Thanks
Is there any environment variable that directadmin store to tell that the host domain is https ready ?
Last edited: