# Uninitialized constant OpenSSL::Digest::SHA1

**URL:** <https://www.ruby-forum.com/t/uninitialized-constant-openssl-sha1/219392>\
**Category:** IronRuby\
**Created:** [May 1, 2012, 7:04pm UTC](https://www.ruby-forum.com/t/uninitialized-constant-openssl-sha1/219392 "2012-05-01T19:04:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gurdipe\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b77776/32.png) [@Gurdipe\_D](https://www.ruby-forum.com/u/Gurdipe_D)\
**Post date:** [May 1, 2012, 7:04pm UTC](https://www.ruby-forum.com/t/uninitialized-constant-openssl-sha1/219392/1 "2012-05-01T19:04:17Z")

</div>

Trying to create a simple “hello world” application. So far I simply  
deleted the /public/index.html file and created a home controller. When  
I try to browse to the page, I get an uninitialized constant  
OpenSSL::Digest::SHA1 error. Couple of pieces of information. OS is  
Windows 7 and I am using the Visual Studio as my IDE. I’ve done some  
googleing, but I haven’t been able to find any articles that describe  
the error I’m having. I’ve installed OpenSSL using a windows installer  
and I tried copying ssleay32.dll and libeay32.dll into the IronRuby bin  
folder, but that did not work. Seems like I must be missing something  
really basic.

Thanks,  
Craig

---

<div class="post-metadata">

**Author:** ![Craig\_Thompson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/97f17d/32.png) [@Craig\_Thompson](https://www.ruby-forum.com/u/Craig_Thompson)\
**Post date:** [May 1, 2012, 11:07pm UTC](https://www.ruby-forum.com/t/uninitialized-constant-openssl-sha1/219392/2 "2012-05-01T23:07:38Z")

</div>

Hi there,

It seems like you are using some kind of framework/web server - what  
would  
that be?  
Do you use Sinatra or how does is your Ruby web application structured?

Best regards,  
Per

---

<div class="post-metadata">

**Author:** ![Craig\_Thompson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/97f17d/32.png) [@Craig\_Thompson](https://www.ruby-forum.com/u/Craig_Thompson)\
**Post date:** [May 2, 2012, 4:33am UTC](https://www.ruby-forum.com/t/uninitialized-constant-openssl-sha1/219392/3 "2012-05-02T04:33:52Z")

</div>

OpenSSL in Ruby is implemented in a C Extension. Last I checked,  
IronRuby can’t load C extensions.

I looked into doing a .NET port of OpenSSL for IronRuby, but quickly got  
lost in the .NET Crypto APIs. This was 2 years ago.

–  
Will G.  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![Craig\_Thompson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/97f17d/32.png) [@Craig\_Thompson](https://www.ruby-forum.com/u/Craig_Thompson)\
**Post date:** [May 2, 2012, 2:38pm UTC](https://www.ruby-forum.com/t/uninitialized-constant-openssl-sha1/219392/4 "2012-05-02T14:38:01Z")

</div>

Thanks for all the responses. The thing that baffling me is that  
IronRuby has an install that includes Visual Studio integration. So, it  
would seem that I should be able to get Hello World to work… I must  
have some specific “oddity” to my system that is hosing the  
IronRuby/Rails install.

Craig

----- Original Message -----

From: “Will G.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
To: removed\_email\_address@domain.invalid  
Sent: Tuesday, May 1, 2012 10:32:54 PM  
Subject: Re: [Ironruby-core] uninitialized constant  
OpenSSL::Digest::SHA1

OpenSSL in Ruby is implemented in a C Extension. Last I checked,  
IronRuby can’t load C extensions.

I looked into doing a .NET port of OpenSSL for IronRuby, but quickly got  
lost in the .NET Crypto APIs. This was 2 years ago.

–  
Will G.  
removed\_email\_address@domain.invalid

* * *

Ironruby-core mailing list  
removed\_email\_address@domain.invalid  
[http://rubyforge.org/mailman/listinfo/ironruby-core](http://rubyforge.org/mailman/listinfo/ironruby-core)

---

<div class="post-metadata">

**Author:** ![Craig\_Thompson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/97f17d/32.png) [@Craig\_Thompson](https://www.ruby-forum.com/u/Craig_Thompson)\
**Post date:** [May 7, 2012, 9:12pm UTC](https://www.ruby-forum.com/t/uninitialized-constant-openssl-sha1/219392/5 "2012-05-07T21:12:03Z")

</div>

Well, I got it to work… But I’m not sure why. In the ActiveSupport  
3.0.1 gem, I made a change to line 59 in the message\_verifier.rb.

I changed it from:  
OpenSSL::HMAC.hexdigest(OpenSSL::Digest.const\_get(@digest).new, @secret,  
data)  
To:  
OpenSSL::HMAC.hexdigest(OpenSSL::Digest::Digest.new(@digest), @secret,  
data)

I have no idea why it worked. Only figured it out by hacking around in  
iirb.

----- Original Message -----

From: “Will G.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
To: removed\_email\_address@domain.invalid  
Sent: Tuesday, May 1, 2012 10:32:54 PM  
Subject: Re: [Ironruby-core] uninitialized constant  
OpenSSL::Digest::SHA1

OpenSSL in Ruby is implemented in a C Extension. Last I checked,  
IronRuby can’t load C extensions.

I looked into doing a .NET port of OpenSSL for IronRuby, but quickly got  
lost in the .NET Crypto APIs. This was 2 years ago.

–  
Will G.  
removed\_email\_address@domain.invalid

* * *

Ironruby-core mailing list  
removed\_email\_address@domain.invalid  
[http://rubyforge.org/mailman/listinfo/ironruby-core](http://rubyforge.org/mailman/listinfo/ironruby-core)
