Giter Club home page Giter Club logo

Comments (6)

luislavena avatar luislavena commented on August 16, 2024

from gem-compiler.

micheelengronne avatar micheelengronne commented on August 16, 2024

Of course,

The dependency installed is apt-get install -y libssl-dev.

The ruby version is ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux-gnu] (eoan)

The gem-compile command is gem compile puma-4.3.3.gem --prune.

When I install it, the SSL support is compiled (/var/lib/gems/2.5.0/gems/puma-4.3.3/ext/puma_http11/puma_http11.so and /var/lib/gems/2.5.0/gems/puma-4.3.3/ext/puma_http11/Makefile exist).

But, when I installed it from the resulting one, /var/lib/gems/2.5.0/gems/puma-4.3.3/ext/puma_http11/puma_http11.so and /var/lib/gems/2.5.0/gems/puma-4.3.3/ext/puma_http11/Makefile do not exist.

When I compile with gem-compile, the log is:

 ERROR:  While executing gem ... (Gem::Compiler::CompilerError)
    The gem file seems to be compiled already.
Unpacking gem: 'puma-4.3.3-x86_64-linux' in temporary directory...

weird.

Wait, I used the 0.8.0 version. I will check further tomorrow.

from gem-compiler.

luislavena avatar luislavena commented on August 16, 2024

from gem-compiler.

luislavena avatar luislavena commented on August 16, 2024

@micheelengronne can you also include the exact command you're using to start puma with SSL?

I just tested in my system and the extension is linked against libcrypto:

luis@Nostromo:~$ asdf shell ruby 2.5.8

luis@Nostromo:~$ ruby -v
ruby 2.5.8p224 (2020-03-31 revision 67882) [x86_64-linux]

luis@Nostromo:~$ gem install puma
Fetching: nio4r-2.5.2.gem (100%)
Building native extensions. This could take a while...
Successfully installed nio4r-2.5.2
Fetching: puma-4.3.4.gem (100%)
Building native extensions. This could take a while...
Successfully installed puma-4.3.4
2 gems installed

luis@Nostromo:~$ gem which puma
/home/luis/.asdf/installs/ruby/2.5.8/lib/ruby/gems/2.5.0/gems/puma-4.3.4/lib/puma.rb

luis@Nostromo:~$ ls /home/luis/.asdf/installs/ruby/2.5.8/lib/ruby/gems/2.5.0/gems/puma-4.3.4/lib/puma
accept_nonblock.rb  cluster.rb        detect.rb         launcher.rb  plugin.rb        runner.rb      thread_pool.rb
app                 commonlogger.rb   dsl.rb            minissl      puma_http11.so   server.rb      util.rb
binder.rb           configuration.rb  events.rb         minissl.rb   rack             single.rb
cli.rb              const.rb          io_buffer.rb      null_io.rb   rack_default.rb  state_file.rb
client.rb           control_cli.rb    jruby_restart.rb  plugin       reactor.rb       tcp_logger.rb

luis@Nostromo:~$ ldd /home/luis/.asdf/installs/ruby/2.5.8/lib/ruby/gems/2.5.0/gems/puma-4.3.4/lib/puma/puma_http11.so
        linux-vdso.so.1 (0x00007ffd371ec000)
        libruby.so.2.5 => /home/luis/.asdf/installs/ruby/2.5.8/lib/libruby.so.2.5 (0x00007f6b7b3d8000)
        libssl.so.1.1 => /usr/lib/x86_64-linux-gnu/libssl.so.1.1 (0x00007f6b7b14b000)
        libcrypto.so.1.1 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 (0x00007f6b7ac80000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f6b7aa61000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6b7a670000)
        libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f6b7a3ef000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f6b7a1eb000)
        libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f6b79fb3000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6b79c15000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f6b7bb15000)

And compiled with gem-compiler:

$ gem list gem-compiler

*** LOCAL GEMS ***

gem-compiler (0.9.0, 0.8.0)

$ gem fetch puma
Fetching: puma-4.3.4.gem (100%)
Downloaded puma-4.3.4

$ gem compile puma-4.3.4.gem
Unpacking gem: 'puma-4.3.4' in temporary directory...
Building native extensions. This could take a while...
  Successfully built RubyGem
  Name: puma
  Version: 4.3.4
  File: puma-4.3.4-x86_64-linux.gem

$ gem unpack puma-4.3.4-x86_64-linux.gem
Unpacked gem: '/tmp/puma-4.3.4-x86_64-linux'

$ ls puma-4.3.4-x86_64-linux/lib/puma
accept_nonblock.rb  cluster.rb        detect.rb         launcher.rb  plugin.rb        runner.rb      thread_pool.rb
app                 commonlogger.rb   dsl.rb            minissl      puma_http11.so   server.rb      util.rb
binder.rb           configuration.rb  events.rb         minissl.rb   rack             single.rb
cli.rb              const.rb          io_buffer.rb      null_io.rb   rack_default.rb  state_file.rb
client.rb           control_cli.rb    jruby_restart.rb  plugin       reactor.rb       tcp_logger.rb

$ ldd puma-4.3.4-x86_64-linux/lib/puma/puma_http11.so
        linux-vdso.so.1 (0x00007ffd89181000)
        libruby.so.2.5 => /home/luis/.asdf/installs/ruby/2.5.8/lib/libruby.so.2.5 (0x00007fdb9210c000)
        libssl.so.1.1 => /usr/lib/x86_64-linux-gnu/libssl.so.1.1 (0x00007fdb91e7f000)
        libcrypto.so.1.1 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 (0x00007fdb919b4000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fdb91795000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fdb913a4000)
        libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007fdb91123000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fdb90f1f000)
        libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007fdb90ce7000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fdb90949000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fdb92849000)

And installing this gem with local certificates, works:

$ gem install --local /tmp/puma-4.3.4-x86_64-linux.gem

$ gem list puma

*** LOCAL GEMS ***

puma (4.3.4 x86_64-linux)

$ ls
config.ru  star-nostromo-dev-cert.pem  star-nostromo-dev-key.pem

$ cat config.ru
run lambda { |env| [200, {"Content-Type" => "text/plain"}, ["Hello World"]] }

$ puma -b 'ssl://0.0.0.0:9292?key=star-nostromo-dev-key.pem&cert=star-nostromo-dev-cert.pem'
Puma starting in single mode...
* Version 4.3.4 (ruby 2.5.8-p224), codename: Mysterious Traveller
* Min threads: 0, max threads: 16
* Environment: development
* Listening on ssl://0.0.0.0:9292?key=star-nostromo-dev-key.pem&cert=star-nostromo-dev-cert.pem
Use Ctrl-C to stop

# on a separate terminal:

$ curl -v -k -i https://localhost:9292/
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 9292 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Unknown (8):
* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Client hello (1):
* TLSv1.3 (OUT), TLS Unknown, Certificate Status (22):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: O=mkcert development certificate; OU=NOSTROMO\Luis@Nostromo (Luis Lavena)
*  start date: Jun  1 00:00:00 2019 GMT
*  expire date: May 19 21:55:04 2030 GMT
*  issuer: O=mkcert development CA; OU=NOSTROMO\Luis@Nostromo (Luis Lavena); CN=mkcert NOSTROMO\Luis@Nostromo (Luis Lavena)
*  SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
* TLSv1.3 (OUT), TLS Unknown, Unknown (23):
> GET / HTTP/1.1
> Host: localhost:9292
> User-Agent: curl/7.58.0
> Accept: */*
>
* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS Unknown, Unknown (23):
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Content-Type: text/plain
Content-Type: text/plain
< Content-Length: 11
Content-Length: 11

<
* TLSv1.3 (IN), TLS Unknown, Unknown (23):
* Connection #0 to host localhost left intact
Hello World

from gem-compiler.

micheelengronne avatar micheelengronne commented on August 16, 2024

Really sorry. That was a mistake on my part. I automatized the builds and the tests.

The tests tested a remote puma gem instead of the local so it didn't work. I will close this issue.

Et je te paye un café la prochaine fois que je me pointe sur Paris.

from gem-compiler.

luislavena avatar luislavena commented on August 16, 2024

@micheelengronne happy to hear that the issue is sorted out! 😅

Have a great day!
❤️ ❤️ ❤️

from gem-compiler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.