سؤال

I'm trying to automate the weekly download of a text file from an https site with a ps1 script. My simple attempts to connect look like this -

Start-BitsTransfer `
-source https://url.com/file `
-destination d:\test.txt

I get the error "The certificate authority is invalid or incorrect". Is there a way to override this CA check?

This Powershell (3.0) script is running on Windows Server 2008R2 and the https://url.com/ SSL cert is issued by Entrust CA. I've tried to add Entrust as a "Trusted Root Certificate Authority" to the "Certificate Store" through IE8. No joy.

هل كانت مفيدة؟

المحلول

This really racked my brain for quite some time. I finally figured out you need to enter the number in decimal not in binary or hex.

C:>bitsadmin /SetSecurityFlags myJob 8

The 8 will make the "Ignore invalid certificate authority in server certificate :true"

نصائح أخرى

http://technet.microsoft.com/en-us/library/cc753211(v=ws.10).aspx

C:\>bitsadmin /SetSecurityFlags myJob 0x011110

I believe I needed to update my Root CA list on the server with a MS Security Update. And bitstransfer can not override a CA check.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top