script help to accept certificate automatically

Advertisement

Kent F
Guest

script help to accept certificate automatically

I'm very grateful for this program. We produce a radio program that we need to automatically upload to our server for radio stations to access. We've successfully done this using Windows Task Scheduler to run WinSCP with arguments (see code below). Our service provider recently switched over to FTPS - Explicit over TLS - which caused connection problems for some of the stations. That is an easy fix. The bigger issue has been when a script/schedule is used and a certificate needs to be accepted in order to connect... which seems to happen from time to time. The scheduled task never completes when a certificate needs to be accepted. We need to be able to have a reliable system... not wondering if the program ever made it to where it's supposed to go.

I've just read about using TlsHostCertificateFingerprint to avoid this certificate problem. I'm not a coder so I need a bit of help. I don't know what the proper syntax would be or where/how to incorporate it into our code below. Can someone point me in the right direction on this? Thanks!

/command "option batch abort" "option confirm off" "open ftp://radioprogram@sample.com@ftp.sample.com" "rm currentprogram.wav" "put C:\radioprogram\currentprogram.wav" "exit"

Also, is there a way to add a command to send us an email to tell us that the task succeeded or failed? That would be bonus.

Thanks!

Kent

Reply with quote

Advertisement

Guest

Re: script help to accept certificate automatically

If I could just see an example of this TlsHostCertificateFingerprint in the context of an argument for scheduler, I think that would be enough to get me going... or if it's not possible to do in the arguments for scheduler, to see what it would look like in a .bat file. If anyone can give me some direction, I would really be grateful.

Kent F wrote:

I'm very grateful for this program. We produce a radio program that we need to automatically upload to our server for radio stations to access. We've successfully done this using Windows Task Scheduler to run WinSCP with arguments (see code below). Our service provider recently switched over to FTPS - Explicit over TLS - which caused connection problems for some of the stations. That is an easy fix. The bigger issue has been when a script/schedule is used and a certificate needs to be accepted in order to connect... which seems to happen from time to time. The scheduled task never completes when a certificate needs to be accepted. We need to be able to have a reliable system... not wondering if the program ever made it to where it's supposed to go.

I've just read about using TlsHostCertificateFingerprint to avoid this certificate problem. I'm not a coder so I need a bit of help. I don't know what the proper syntax would be or where/how to incorporate it into our code below. Can someone point me in the right direction on this? Thanks!

/command "option batch abort" "option confirm off" "open ftp://radioprogram@sample.com@ftp.sample.com" "rm currentprogram.wav" "put C:\radioprogram\currentprogram.wav" "exit"

Also, is there a way to add a command to send us an email to tell us that the task succeeded or failed? That would be bonus.

Thanks!

Kent

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,517
Location:
Prague, Czechia

Re: script help to accept certificate automatically

/command ... "open -certificate=""xx:xx:xx:xx..."" ftp://radioprogram@sample.com@ftp.sample.com" ... "exit"

Though
certificate needs to be accepted in order to connect... which seems to happen from time to time
It seems like the certificate is changing, so the above cannot help, as it is there to accept certain "known" certificate.
You can hack it by accepting any certificate using -certificate=*, but you loose ANY SECURITY by doing so.

Reply with quote

Advertisement

You can post new topics in this forum