WEBRick auto generated SSL certificate

Where do I look for/find the parameters that ::SSLCertName will accept
for WEBrick’s auto-generated certificate?

Specifically, I am trying to find out if there is a way to generate or
pass a unique certificate serial number each time the secure server
starts as Firefox borks after the first certificate due to them all
having the same serial number (presumably 0).

Regards,

James B. wrote:

Where do I look for/find the parameters that ::SSLCertName will accept
for WEBrick’s auto-generated certificate?

OK. I found /ruby/1.8/webrick/ssl.rb and on line 54 I see:

cert.serial = 0

Now, the module call is:

module Utils
def create_self_signed_cert(bits, cn, comment)

So from the server script I see this:

:SSLCertName => [ [ “CN”, WEBrick::Utils::getservername ] ]

So there does not seem to me to be any way to pass a serial number to
ssl.rb. So is there a way to extend ssl.rb in the script or need I
modify ssl.rb for my installation to get a random (and hopefully unique)
certificate serial number?

See Rails Trac Ticket #9551

Patch file for webrick/ssl.rb attached for anyone who cares.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs