Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Peer certificate cannot be authenticated with given CA certificates #31

Closed
hussius opened this issue May 10, 2017 · 7 comments
Closed
Assignees
Milestone

Comments

@hussius
Copy link

hussius commented May 10, 2017

I get the following error when trying to open a remote file:

>>> bw = pyBigWig.open("https://data.broadinstitute.org/compbio1/PhyloCSFtracks/hg19/latest/PhyloCSF+0.bw")
[urlOpen] curl_easy_perform received an error: Peer certificate cannot be authenticated with given CA certificates

I've tried to install new CA certificates on my Mac (El Capitan 10.11.6) by following instructions I found online, but they don't seem to fix the issue so far. Would be grateful for suggestions.

@ghuls
Copy link

ghuls commented May 10, 2017

Does the command line version of curl work for you?

curl -O "https://data.broadinstitute.org/compbio1/PhyloCSFtracks/hg19/latest/PhyloCSF+0.bw"

@dpryan79
Copy link
Collaborator

@hussius As @ghuls mentioned, if you can get curl on the command line to work then pyBigWig should work too.

I should note that I've been meaning to have open() default to ignoring SSL certificate issues, since I don't expect regular end users (e.g., all the deepTools users) to have to deal with that.

@hussius
Copy link
Author

hussius commented May 10, 2017

It does work for me on the command line.

130-229-4-255-dhcp:~ mikaelhuss$ curl -O "https://data.broadinstitute.org/compbio1/PhyloCSFtracks/hg19/latest/PhyloCSF+0.bw"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0 3019M    0 4622k    0     0  1189k      0  0:43:19  0:00:03  0:43:16 1189k

@dpryan79
Copy link
Collaborator

My only guess is that whichever libcurl pyBigWig is getting linked against is using a different CAPATH. I really just need to adjust pyBigWig to ignore such things by default. In the interim, you can add the following to libBigWig/io.c after line 234:

if(curl_easy_setopt(URL->x.curl, CURLOPT_SSL_VERIFYPEER, 0) != CURLE_OK) {
    fprintf(stderr, "[urlOpen] Couldn't set CURLOPT_SSL_VERIFYPEER to 0!\n");
    goto error;
}

That won't solve the root problem, but it'll probably get things running.

@hussius
Copy link
Author

hussius commented May 10, 2017

Go figure - it works for me now in a fresh conda environment. I did not try the @dpryan79 addition because with my conda-installed package on Mac, pyBigWig.__file__ points to a .so file and I can't find any C source files. Cheers!

@dpryan79
Copy link
Collaborator

Ah, I'm not sure conda was using the system-installed certificates (there have also been on-going issues with libcurl on OSX in conda, I used to have a separate curl inside bioconda for this reason). Anyway, I'll leave this open as a reminder to myself to just have these sorts of errors ignored.

@dpryan79 dpryan79 added this to the 0.3.5 milestone Sep 15, 2017
@dpryan79 dpryan79 self-assigned this Sep 15, 2017
dpryan79 added a commit that referenced this issue Sep 15, 2017
…here are enough occasional libcurl CACERT issues, especially in conda)
@dpryan79 dpryan79 mentioned this issue Sep 15, 2017
@dpryan79
Copy link
Collaborator

Starting in version 0.3.5 certificate issues should generally be ignored. I considered making certificate checks optional, but I suspect no one would ever actually bother to use that and adding it in would be a bit annoying, so I'll hold off unless someone explicitly asks for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants