问题
I am trying to connect to my web server via my Atom editor, however whenever I try to connect with {"rejectUnauthorized": true,}, I received this error:
Hostname/IP does not match certificate's altnames: Host: myhost.com. is not in the cert's altnames: DNS:dns.name
I can connect fine with the following code:
{
"protocol": "ftp",
"host": "myhost.com",
"port": 21,
"user": "username**",
"pass": "password**",
"promptForPass": false,
"remote": "/",
"local": "",
"secure": true,
"secureOptions": {"rejectUnauthorized": false, "requestCert": true, "agent": false},
"connTimeout": 10000,
"pasvTimeout": 10000,
"keepalive": 10000,
"watch": [],
"watchTimeout": 500
}
However, from what I read, "rejectUnauthorized": false is not a very smart way to be transferring files. As it can cause a MITM attack.
I am using an automatically created Let's Encrypt SSL cert & Siteground for my hosting. Any help would be greatly appreciated.
Thanks in advance.
回答1:
I am using an automatically created Let's Encrypt SSL cert & Siteground for my hosting. Any help would be greatly appreciated.
I don't know the setup run by Siteground but my guess is that
- This is a shared hosting, i.e. you don't get a dedicated IP address for your domain but share it with others.
- The Let's Encrypt certificate is only installed for HTTPS (i.e. web access).
- With FTPS a single certificate is used on the IP address and thus is what you get. While with HTTPS it is is common to have multiple certificates per IP address by using Server Name Indication (SNI) this is usually not the case for other protocols like FTPS, SMTPS...
If my guess is correct then this is a shared FTPS server for all domains hosted on the system and the access to the users data is restricted by username+password and not by the domain name used to connect. In this case you are actually not expected to use your own domain name to access FTPS but you should use the common name (which is found in the certificate) and then login with your specific account.
It looks like that this is even documented. From Siteground FAQ: How to establish an FTP connection to your hosting account?:
FTP Hostname - This is the hosting server name.
Thus, you are not expected to use your own domain name but the name of the hosting server. This name can be found in your Account Information.
来源:https://stackoverflow.com/questions/59474318/cant-seem-to-connect-to-ftps-via-atom-editor-remote-ftp