Post a reply

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


Thank you @martin.

I should have targeted the -certificate parameter for the open command instead

thank you
appreciate it

Re: WinSCP command has no option for hostkey

The switch should go to the open command in your script. Also, as this is about a TLS/SSL certificate (not an SSH host key), it should be -certificate, not -hostkey:
open ftps:// -certificate=aa:bb:cc...

WinSCP command has no option for hostkey

Hi I am trying to use WinSCP to do some backend job in command execution of SQLServer. I need to accept the certificate regardless of the hostkey. Is there any changes on the command? Please if you can advise what to do.

exec master..xp_cmdshell ' /hostkey=* /script=C:\file'

I am getting this error:
Connecting to ...
The server's certificate is not known. You have no guarantee that the server is the computer you think it is.
Server's certificate details follow:
- Organization: localhost
- Organization: localhost
Valid: 9/13/2019 9:05:09 AM - 9/13/2024 12:00:00 AM
Fingerprint (SHA-1): cc:bb:48:76:39:e2:45:6d:01:16:d6:43:be:18:16:03:56:07:d9:d1
Summary: Unable to get local issuer certificate. The error occurred at a depth of 1 in the certificate chain.
When connecting using an IP address, it is not possible to verify if the certificate was issued for the server. Use a hostname instead of the IP address.
If you trust this certificate, press Yes. To connect without storing certificate, press No. To abandon the connection press Cancel.
Continue connecting and store the certificate?
(Y)es, (N)o, C(a)ncel (10 s), (C)opy Key: Cancel
Connection failed.
Peer certificate rejected

Disconnected from server

Connection failed.