Skip to content

On ubuntu 16.04, "certificate verify failed" errors for www.google.com #4802

@mohamedhafez

Description

@mohamedhafez

I just did a apt dist-upgrade on my ubuntu 16.04 machine, and now when net::http tries to connect to www.google.com, it throws a "OpenSSL::SSL::SSLError: certificate verify failed". The ubuntu packages that got upgraded apparently affect the cert files and certificate verification, so i'm guessing that breaks jruby somehow:

ca-certificates 20170717~16.04.1
libidn11 1.32-3ubuntu1.2
libnss3 2:3.28.4-0ubuntu0.16.04.3
libnss3-nssdb 2:3.28.4-0ubuntu0.16.04.3

I thought it might be a bug with one of the packages, but curl still works without issue, and also the following code works in irb on ruby-2.3.0 on ubuntu, jruby 9.1.13.0 on mac, but not jruby 9.1.13.0 on my ubuntu machine:

require 'net/http'
uri = URI.parse("https://www.google.com/")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.request(Net::HTTP::Get.new(uri.request_uri))

### Environment
JRuby version (jruby -v) and command line (flags, JRUBY_OPTS, etc):
jruby 9.1.13.0 (2.3.3) 2017-09-06 8e1c115 OpenJDK 64-Bit Server VM 25.131-b11 on 1.8.0_131-8u131-b11-2ubuntu1.16.04.3-b11 +jit [linux-x86_64]

Operating system and platform (e.g. uname -a)
Linux momoserver 4.4.0-96-generic #119-Ubuntu SMP Tue Sep 12 14:59:54 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

### Expected Behavior
www.google.com's ssl certificate should be verified without issue

### Actual Behavior
OpenSSL::SSL::SSLError: certificate verify failed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions