Project

General

Profile

This project is closed and read-only.

Actions

Bug #863

closed

Openssl issues with fresh compile on Ubuntu

Bug #863: Openssl issues with fresh compile on Ubuntu

Added by btakita (Brian Takita) almost 18 years ago. Updated about 7 years ago.

Status:
Closed
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

Updated by candlerb (Brian Candler) almost 18 years ago Actions #1

=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

Updated by candlerb (Brian Candler) almost 18 years ago Actions #2

=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

Updated by thewoolleyman (Chad Woolley) over 17 years ago Actions #3

=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

Updated by thewoolleyman (Chad Woolley) over 17 years ago Actions #4

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

Updated by nobu (Nobuyoshi Nakada) over 17 years ago Actions #5

=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

Updated by nobu (Nobuyoshi Nakada) over 17 years ago Actions #6

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

=begin

=end

Updated by thewoolleyman (Chad Woolley) over 17 years ago Actions #7

=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

Updated by matz (Yukihiro Matsumoto) over 17 years ago Actions #8

=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 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

Updated by thewoolleyman (Chad Woolley) over 17 years ago Actions #9

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

Updated by matz (Yukihiro Matsumoto) over 17 years ago Actions #10

=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 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

Updated by rogerdpack (Roger Pack) over 17 years ago Actions #11

=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

Updated by marcandre (Marc-Andre Lafortune) almost 17 years ago Actions #12

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

=begin

=end

Updated by jeremyevans0 (Jeremy Evans) about 7 years ago Actions #13

  • Description updated (diff)
  • Status changed from Assigned to Closed
Actions

Also available in: PDF Atom