Post a reply

Options
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)

Options

Topic review

Abdulkarim

Thank you @martin.

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

thank you
appreciate it
martin

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://username@example.com/ -certificate=aa:bb:cc...

https://winscp.net/eng/docs/scriptcommand_open#certificate
Abdulkarim

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 'winscp.com /hostkey=* /script=C:\file'


I am getting this error:
Connecting to 10.xxx.xxx.xxx ...
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:
Issuer:
- Organization: localhost
Subject:
- 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.