Sketchup::require 'openssl'

Hi,
On all my extension, I use openssl.
One of my customer I have this error:
SketchUp : 24.0.553

OS : Windows 11

Ruby : 3.2.2

Extension : [unknown]

Erreur : LoadError ()

<internal:C:/Program Files/SketchUp/SketchUp 2024/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb>:85:in `require’

<internal:C:/Program Files/SketchUp/SketchUp 2024/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb>:85:in `require’

C:/Program Files/SketchUp/SketchUp 2024/Tools/RubyStdLib/openssl.rb:13:in `<top (required)>’

C:/Users/admin/AppData/Roaming/SketchUp/SketchUp 2024/SketchUp/Plugins/VMS_Up_extensions.rb:12:in `require’

C:/Users/admin/AppData/Roaming/SketchUp/SketchUp 2024/SketchUp/Plugins/VMS_Up_extensions.rb:12:in `<top (required)>’

I have no idea why ?

Denis, this is an easy one. Your customer is not running the latest release of SketchUp 2024.

If you look at the Application Release Notes for 24.0.2 you will see …

  • Updated OpenSSL to version 3.2.2. Extension developers using any functionality relying on OpenSSL should test that their extensions function as expected.

Also, (although not critical) it is not necessary to use the API Sketchup::require method to load Ruby standard library files. It will just add another call to the call stack as the API method will just pass the argument on to the global require method.

I just tested loading OpenSSL on the latest version of SU 2024 and got a true result.

Something odd is going on. All versions of SU should be able to load OpenSSL.

Or, all versions will load the dlls they were compiled with (they’re bundled with the SU install). Older versions do use OpenSSL 1.1 or 1.0, which are EOL.

EDIT:

You might have the user check if the files needed exist. The error text you listed shows there is an issue loading openssl.so (from openssl.rb:13).

In the folder:

C:/Program Files/SketchUp/SketchUp 2024/Tools/RubyStdLib/platform_specific

openssl.so should exist.

For SU 2024.0.2 (24.0.594), the dll files libcrypto-3-x64.dll & libssl-3-x64.dll should exist.

For SU 2024.0.1 (24.0.553) and earlier, the dll files libcrypto-1_1-x64.dll & libssl-1_1-x64.dll should exist. Also, at some point, the dll’s also existed in the SU root folder. Not sure what version changed that…

A one liner for the console:

dir = RbConfig::CONFIG['topdir']; puts dir; s = ''; Dir["*{ssl,crypto}*", base: dir].sort.each { |fn| s << "#{fn}\n" }; puts s

For SU 2024 & 2025 should output:

C:/Program Files/SketchUp/SketchUp 202*/SketchUp/Tools/RubyStdLib/platform_specific
libcrypto-3-x64.dll
libssl-3-x64.dll
openssl.so

Im waiting for my customer feedback, and keep you in touch

I’d appreciate that. I’ve watched the ruby/openssl repo on GitHub for a long time, and have also worked with OpenSSL, both Ruby and C. I have one extension, and the last update (early 2024) added a feature to check for updates, as they host it on their own web site. The code uses OpenSSL.

Between the extension and my GitHub activity, I don’t recall the problem your user is having occurring on Windows. There have been some macOS issues (stand-alone Ruby, not with SU), but that was related to some Ruby version managers installing/changing the default cert data.

Maybe anti-virus not liking the compiled *.so file, not sure…

I haven’t any news since I advice him to migrate to the last release of Sketchup 2024.
I France, we say : no news => good news.