Kazuki Yamaguchi 01d368e7b0 [ruby/openssl] ssl: raise SSLError if loading ca_file or ca_path fails
When compiled with OpenSSL <= 1.1.1, OpenSSL::SSL::SSLContext#setup
does not raise an exception on an error return from
SSL_CTX_load_verify_locations(), but instead only prints a verbose-mode
warning. This is not helpful since it very likely indicates an actual
error, such as the specified file not being readable.

Also, OpenSSL's error queue is not correctly cleared:

	$ ruby -w -ropenssl -e'OpenSSL.debug=true; ctx=OpenSSL::SSL::SSLContext.new; ctx.ca_file="bad-path"; ctx.setup; pp OpenSSL.errors'
	-e:1: warning: can't set verify locations
	["error:02001002:system library:fopen:No such file or directory",
	 "error:2006D080:BIO routines:BIO_new_file:no such file",
	 "error:0B084002:x509 certificate routines:X509_load_cert_crl_file: system lib"]

The behavior is currently different when compiled with OpenSSL >= 3.0:
SSLError is raised if SSL_CTX_load_verify_file() or
SSL_CTX_load_verify_dir() fails.

This inconsistency was unintentionally introduced by commit https://github.com/ruby/openssl/commit/5375a55ffc35
("ssl: use SSL_CTX_load_verify_{file,dir}() if available", 2020-02-22).
However, raising SSLError seems more appropriate in this situation.
Let's adjust the OpenSSL <= 1.1.1 code so that it behaves the same way
as the OpenSSL >= 3.0 code currently does.

Fixes: https://github.com/ruby/openssl/issues/649

https://github.com/ruby/openssl/commit/7eb10f7b75
2023-08-16 14:48:41 +09:00
2023-08-15 23:30:40 +09:00
2023-08-11 01:56:50 +09:00
2023-06-08 17:25:38 +09:00
2023-07-14 18:35:23 +09:00
2023-08-15 23:30:40 +09:00
2023-08-08 08:34:53 +09:00
2023-08-15 23:30:40 +09:00
2023-05-27 02:07:47 +09:00
2023-06-29 17:00:40 -04:00
2023-08-03 09:51:52 +09:00
2023-08-11 17:53:53 -04:00
2023-06-12 18:23:48 +09:00
2023-06-30 14:59:34 +00:00
2023-07-13 09:21:36 +01:00
2023-04-10 01:09:03 +09:00
2023-08-01 22:46:17 +09:00
2023-03-06 21:59:23 -08:00
2023-07-21 15:44:24 -04:00
2023-07-23 10:24:19 -04:00
2023-08-12 13:04:04 -04:00
GPL
2023-08-12 10:04:39 -04:00
2023-03-06 21:59:23 -08:00
2023-07-13 09:27:33 -04:00
2023-08-12 13:04:04 -04:00
2023-08-01 22:46:17 +09:00
2023-08-01 22:46:17 +09:00
2023-03-15 09:53:49 -07:00
2023-07-28 19:39:43 +09:00
2023-07-17 23:57:11 +09:00
2023-07-31 17:13:43 +09:00
2023-08-12 07:00:20 +00:00
2023-06-12 18:23:48 +09:00
2023-08-13 15:47:12 -04:00
2023-08-13 21:23:41 -04:00
2023-08-09 14:06:58 -04:00
2023-03-08 12:00:14 -08:00
2023-08-07 09:51:03 -04:00
2023-07-31 09:17:18 -04:00
2023-07-27 13:33:40 -04:00
2023-04-26 18:19:48 -07:00
2023-04-04 00:35:29 -07:00
2023-03-12 15:15:08 -07:00
2023-03-06 22:14:44 -08:00
2023-07-04 21:30:44 +09:00
2023-07-19 14:35:43 +09:00
2023-07-13 14:48:14 -04:00
2023-04-04 11:12:07 -04:00
2023-03-06 23:44:01 -08:00
2023-07-31 17:13:43 +09:00
2023-07-27 17:27:05 -07:00
2023-07-31 17:13:43 +09:00
2023-07-27 17:27:05 -07:00
2023-07-31 17:13:43 +09:00
2023-07-27 17:27:05 -07:00
2023-08-01 22:46:17 +09:00
2023-08-08 16:06:22 -07:00

Actions Status: MinGW Actions Status: RJIT Actions Status: Ubuntu Actions Status: Windows AppVeyor status Travis Status Cirrus Status

What is Ruby?

Ruby is an interpreted object-oriented programming language often used for web development. It also offers many scripting features to process plain text and serialized files, or manage system tasks. It is simple, straightforward, and extensible.

Features of Ruby

  • Simple Syntax
  • Normal Object-oriented Features (e.g. class, method calls)
  • Advanced Object-oriented Features (e.g. mix-in, singleton-method)
  • Operator Overloading
  • Exception Handling
  • Iterators and Closures
  • Garbage Collection
  • Dynamic Loading of Object Files (on some architectures)
  • Highly Portable (works on many Unix-like/POSIX compatible platforms as well as Windows, macOS, etc.) cf. https://docs.ruby-lang.org/en/master/maintainers_md.html#label-Platform+Maintainers

How to get Ruby

For a complete list of ways to install Ruby, including using third-party tools like rvm, see:

https://www.ruby-lang.org/en/downloads/

You can download release packages and the snapshot of the repository. If you want to download whole versions of Ruby, please visit https://www.ruby-lang.org/en/downloads/releases/.

Download with Git

The mirror of the Ruby source tree can be checked out with the following command:

$ git clone https://github.com/ruby/ruby.git

There are some other branches under development. Try the following command to see the list of branches:

$ git ls-remote https://github.com/ruby/ruby.git

You may also want to use https://git.ruby-lang.org/ruby.git (actual master of Ruby source) if you are a committer.

How to build

See Building Ruby

Ruby home page

https://www.ruby-lang.org/

Documentation

Mailing list

There is a mailing list to discuss Ruby. To subscribe to this list, please send the following phrase:

join

in the mail subject (not body) to the address ruby-talk-request@ml.ruby-lang.org.

Copying

See the file COPYING.

Feedback

Questions about the Ruby language can be asked on the Ruby-Talk mailing list or on websites like https://stackoverflow.com.

Bugs should be reported at https://bugs.ruby-lang.org. Read "Reporting Issues" for more information.

Contributing

See "Contributing to Ruby", which includes setup and build instructions.

The Author

Ruby was originally designed and developed by Yukihiro Matsumoto (Matz) in 1995.

matz@ruby-lang.org

Description
Languages
Ruby 58.9%
C 29.5%
Rust 6.1%
C++ 2.9%
Yacc 0.9%
Other 1.6%