Project

General

Profile

Bug #863

Openssl issues with fresh compile on Ubuntu

Added by btakita (Brian Takita) over 10 years ago. Updated about 8 years ago.

Status:
Assigned
Priority:
Normal
ruby -v:
ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-linux]
[ruby-core:20502]

Description

=begin
To reprodule I,

  • uncommented openssl in ext/Setup
  • ./configure
  • make
  • make install

Openssl compiled successfully. However when I run irb, I get the following error.

uninitialized constant OpenSSL::SSL::VERIFY_PEER in ssl.rb
=end


Files

mkmf.log (51.9 KB) mkmf.log thewoolleyman (Chad Woolley), 05/07/2009 01:46 PM

History

#1

Updated by candlerb (Brian Candler) over 10 years ago

=begin
Which Ruby? Which Ubuntu? Which OpenSSL?

I had no problems building ruby-1.9.1 preview1 and preview2 under Ubuntu Hardy with stock openssl (0.9.8g-4ubuntu3.3)

I also didn't have to hack ext/Setup. I just did ./configure --program-suffix=19

$ irb19
irb(main):001:0> require 'openssl'
=> true
irb(main):002:0> OpenSSL::SSL::VERIFY_PEER
=> 1
irb(main):003:0>

Did you remember to install the libssl-dev package first?

What does ext/openssl/mkmf.log show?

=end

#2

Updated by candlerb (Brian Candler) over 10 years ago

=begin
And I've also just got the same successful result with ruby-1.8.7-p72 on the same platform.

./configure --program-suffix=187
make
sudo mv /usr/local/lib/ruby /usr/local/lib/rubyxx
sudo make install

$ irb187
irb(main):001:0> RUBY_VERSION
=> "1.8.7"
irb(main):002:0> require 'openssl'
=> true
irb(main):003:0> OpenSSL::SSL::VERIFY_PEER
=> 1

(I'm not sure if there is a clean way to install 1.8.7 alongside 1.8.6. I see ./configure --help shows how to relocate the vendor_ruby and site_ruby directories, but I can't see the same for RUBY_LIB)

=end

#3

Updated by thewoolleyman (Chad Woolley) about 10 years ago

=begin
I got the same thing:

/usr/local/lib/ruby/1.8/openssl/ssl.rb:26: uninitialized constant OpenSSL::SSL::VERIFY_PEER (NameError)
from /usr/local/lib/ruby/1.8/openssl.rb:23:in `require'
from /usr/local/lib/ruby/1.8/openssl.rb:23

Here's my info:

user@user-desktop:~/install/ruby/ruby-1.8.7-p72/ext/openssl$ ruby -v
ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-linux]
user@user-desktop:~/install/ruby/ruby-1.8.7-p72/ext/openssl$ cat /etc/issue
Ubuntu jaunty (development branch) \n \l

user@user-desktop:~/install/ruby/ruby-1.8.7-p72/ext/openssl$ dpkg -l | grep openssl
ii openssl 0.9.8g-15ubuntu3 Secure Socket Layer (SSL) binary and related
ii openssl-blacklist 0.4.2 list of blacklisted OpenSSL RSA keys

I don't have ext/openssl/mkmf.log - I did, but then I did a clean recompile and it is not there anymore.
=end

#4

Updated by thewoolleyman (Chad Woolley) about 10 years ago

=begin
I just got this again on a new Ubuntu 8.10 install. I'm attaching the mkmf.log this time.
=end

#5

Updated by nobu (Nobuyoshi Nakada) about 10 years ago

=begin
Hi,

At Sat, 13 Dec 2008 01:38:09 +0900,
Brian Takita wrote in [ruby-core:20502]:

Openssl compiled successfully. However when I run irb, I get the following error.

uninitialized constant OpenSSL::SSL::VERIFY_PEER in ssl.rb

How do you reproduce it?

$ ruby18 -ropenssl -e 'p OpenSSL::SSL::VERIFY_PEER'
1

$ ruby18 -ropenssl.so -e 'p OpenSSL::SSL::VERIFY_PEER'
/opt/local/lib/ruby/1.8/openssl/ssl.rb:26: uninitialized constant OpenSSL::SSL::VERIFY_PEER (NameError)
from /opt/local/lib/ruby/1.8/openssl.rb:23:in `require'
from /opt/local/lib/ruby/1.8/openssl.rb:23

If this is the case, why do you require the extension only, but
not the script?

--
Nobu Nakada

=end

#6

Updated by nobu (Nobuyoshi Nakada) about 10 years ago

  • Status changed from Open to Feedback
  • ruby -v set to ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-linux]

=begin

=end

#7

Updated by thewoolleyman (Chad Woolley) about 10 years ago

=begin
Your first command fails for me:

$ /usr/local/lib/ruby1.8.7/bin/ruby1.8.7 -ropenssl -e 'p OpenSSL::SSL::VERIFY_PEER'
/usr/local/lib/ruby1.8.7/lib/ruby/1.8/openssl/ssl.rb:26: uninitialized constant OpenSSL::SSL::VERIFY_PEER (NameError)
from /usr/local/lib/ruby1.8.7/lib/ruby/1.8/openssl.rb:23:in `require'
from /usr/local/lib/ruby1.8.7/lib/ruby/1.8/openssl.rb:23
=end

#8

Updated by matz (Yukihiro Matsumoto) about 10 years ago

=begin
Hi,

In message "Re: [ruby-core:23383] [Bug #863] Openssl issues with fresh compile on Ubuntu"
on Thu, 7 May 2009 16:11:58 +0900, Chad Woolley redmine@ruby-lang.org writes:

|Your first command fails for me:
|
|$ /usr/local/lib/ruby1.8.7/bin/ruby1.8.7 -ropenssl -e 'p OpenSSL::SSL::VERIFY_PEER'
|/usr/local/lib/ruby1.8.7/lib/ruby/1.8/openssl/ssl.rb:26: uninitialized constant OpenSSL::SSL::VERIFY_PEER (NameError)
| from /usr/local/lib/ruby1.8.7/lib/ruby/1.8/openssl.rb:23:in `require'
| from /usr/local/lib/ruby1.8.7/lib/ruby/1.8/openssl.rb:23

It's caused by recursive require. There must be TRUE reason behind
why recursive require happens, e.g. RUBYOPT environment variable, but
the following patch stops recursive calls. Could you see if the patch
works?

                        matz.

diff --git a/ext/openssl/ossl_digest.c b/ext/openssl/ossl_digest.c
index 5bb55af..eac6541 100644
--- a/ext/openssl/ossl_digest.c
+++ b/ext/openssl/ossl_digest.c
@@ -233,7 +233,6 @@ ossl_digest_block_length(VALUE self)
void
Init_ossl_digest()
{

  • rb_require("openssl"); rb_require("digest");

#if 0 /* let rdoc know about mOSSL */

=end

#9

Updated by thewoolleyman (Chad Woolley) about 10 years ago

=begin
Yes! This patch does seem to fix it. Thanks, Matz...
=end

#10

Updated by matz (Yukihiro Matsumoto) about 10 years ago

=begin
Hi,

In message "Re: [ruby-core:23411] [Bug #863] Openssl issues with fresh compile on Ubuntu"
on Sun, 10 May 2009 06:38:17 +0900, Chad Woolley redmine@ruby-lang.org writes:

|Yes! This patch does seem to fix it. Thanks, Matz...

Hmm, still something is wrong though. I don't know why openssl.so is
required firsthand. Anyway, I will check in the patch.

                        matz.

=end

#11

Updated by rogerdpack (Roger Pack) about 10 years ago

=begin
I would double check it but 1.8.7 from source gives me:

make[1]: Entering directory /free_space/rdp/downloads/ruby_1_8_svn/ext/thread'
gcc -I. -I../.. -I../../. -I../.././ext/thread -D_FILE_OFFSET_BITS=64 -DUSE_MEM_POOLS -fPIC -O2 -g -Wall -Wno-parentheses -fPIC -c thread.c
thread.c: In function ‘unlock_mutex_inner’:
thread.c:485: error: ‘list’ undeclared (first use in this function)
thread.c:485: error: (Each undeclared identifier is reported only once
thread.c:485: error: for each function it appears in.)
make[1]: *** [thread.o] Error 1
make[1]: Leaving directory
/free_space/rdp/downloads/ruby_1_8_svn/ext/thread'
make: *** [mkmain.sh] Error 1

:)
-=r

=end

#12

Updated by marcandre (Marc-Andre Lafortune) over 9 years ago

  • Category set to build
  • Status changed from Feedback to Assigned
  • Assignee set to matz (Yukihiro Matsumoto)

=begin

=end

Also available in: Atom PDF