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

SSL Cert issue on 1.7.* #2897

Closed
fkchang opened this issue Apr 30, 2015 · 4 comments
Closed

SSL Cert issue on 1.7.* #2897

fkchang opened this issue Apr 30, 2015 · 4 comments

Comments

@fkchang
Copy link

fkchang commented Apr 30, 2015

Pivotal tracker API updated it's cert and now we can't connect on 1.7.13 and 1.7.18. Upgrading to Jruby 9K pre2 took care of the issue. Script to duplicate on the bottom(need pivotal tracker token and project id to pass to it). Script also runs on MRI

stack trace

null:-1:in `getConvertedValue': java.lang.RuntimeException: can't recode value for oid 2.5.4.9
from null:-1:in `toASN1Primitive'
from null:-1:in `setSubject'
from null:-1:in `setSubjectDN'
from X509Cert.java:328:in `set_subject'
from X509Cert.java:174:in `initialize'
from X509Cert$INVOKER$i$0$1$initialize.gen:-1:in `call'
from DynamicMethod.java:210:in `call'
from CachingCallSite.java:336:in `cacheAndCall'
from CachingCallSite.java:179:in `callBlock'
from CachingCallSite.java:183:in `call'
from RubyClass.java:804:in `newInstance'
from RubyClass$INVOKER$i$newInstance.gen:-1:in `call'
from JavaMethod.java:297:in `call'
from RubyClass.java:690:in `finvoke'
from Helpers.java:502:in `invoke'
from RubyBasicObject.java:363:in `callMethod'
from X509Cert.java:134:in `wrap'
from SSLSocket.java:786:in `peer_cert'
from SSLSocket$INVOKER$i$0$0$peer_cert.gen:-1:in `call'

Script to duplicate

# extracted from the tracker_api gem
require 'rubygems'
require 'faraday'
require 'faraday_middleware'

if ARGV.size != 2
  puts "usage: project_id pivotal_token"
  return
end

project_id = ARGV[0]
token = ARGV[1]

puts "project_id: #{project_id}"
puts "token:       #{token}"

url =  "https://www.pivotaltracker.com/services/v5/projects/#{project_id}"


connection = Faraday.new({url: url}) do |builder|
  builder.use Faraday::Response::RaiseError
  builder.response :json

  # request
  builder.request :multipart
  builder.request :json

  builder.adapter :net_http
end

response = connection.get do |req|

  req.url(url)
  headers = {
    'User-Agent' => 'Ruby/2.0.0 (java; jruby) Faraday/0.8.9',
    'X-TrackerToken' => token
  }
  req.headers.merge!(headers)

end
pp response
@headius
Copy link
Member

headius commented Apr 30, 2015

This might simply be the newer jruby-openssl that ships with 9k. Can you try to install the latest jruby-openssl on 1.7.19 and see if it works?

@headius
Copy link
Member

headius commented May 4, 2015

@fkchang Ping...can you try updated jruby-openssl on 1.7.19?

@headius headius modified the milestones: JRuby 1.7.21, JRuby 1.7.20 May 4, 2015
@azolotko
Copy link
Contributor

I've just tested with jruby-openssl 0.9.7 and JRuby 1.7.19. Everything works fine.

@mkristian
Copy link
Member

then things are fixed with jruby-1.7.20 already since it comes with jruby-openssl-0.9.7

@kares kares modified the milestones: JRuby 1.7.20, JRuby 1.7.21 May 15, 2015
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

5 participants