简体   繁体   中英

wget unable to establish SSL connection in bash script

The following command works on the command line:

wget --secure-protocol=PFS -O dcm4chee-arc-5.15.1-mysql.zip https://sourceforge.net/projects/dcm4che/files/dcm4chee-arc-light5/5.15.1/dcm4chee-arc-5.15.1-mysql.zip/download

However, when I put the exact same line into a bash script (it's inside a function), it results in this error:

Resolving sourceforge.net (sourceforge.net)... 216.105.38.13

Connecting to sourceforge.net (sourceforge.net)|216.105.38.13|:443... connected.

Unable to establish SSL connection.

I've even pulled it out of the function to see if that makes any difference, but it doesn't.

Any thoughts?

Kicking myself ... my IDE had #!/usr/bin/env bash at the top of the file, whereas changing it to simply #!/bin/bash made everything work as expected. I thank you all for the responses, crediting @Mihai with direct assistance due to the comment about "environment"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM