lib/openssl/ssl.rb in rubysl-openssl-2.9 vs lib/openssl/ssl.rb in rubysl-openssl-2.10
- old
+ new
@@ -161,10 +161,11 @@
to_io.do_not_reverse_lookup = flag
end
end
def verify_certificate_identity(cert, hostname)
+ Rubinius.synchronize(SSL) do
should_verify_common_name = true
cert.extensions.each{|ext|
next if ext.oid != "subjectAltName"
ostr = OpenSSL::ASN1.decode(ext.to_der).value.last
sequence = OpenSSL::ASN1.decode(ostr.value)
@@ -190,10 +191,11 @@
return true if verify_hostname(hostname, value)
end
}
end
return false
+ end
end
module_function :verify_certificate_identity
def verify_hostname(hostname, san) # :nodoc:
# RFC 5280, IA5String is limited to the set of ASCII characters
@@ -280,10 +282,12 @@
@io = io
@context = context
@sync_close = false
@hostname = nil
@io.nonblock = true if @io.respond_to?(:nonblock=)
+ Rubinius.synchronize(SSL) do
context.setup
+ end
super()
end
end
# call-seq: