<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/openssl/test_ssl.rb, branch v3_3_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[ruby/openssl] ssl: raise SSLError if loading ca_file or ca_path fails</title>
<updated>2023-08-16T05:48:41+00:00</updated>
<author>
<name>Kazuki Yamaguchi</name>
<email>k@rhe.jp</email>
</author>
<published>2023-08-09T17:45:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=01d368e7b06ccf34f92c535a117a2856956d2bcb'/>
<id>01d368e7b06ccf34f92c535a117a2856956d2bcb</id>
<content type='text'>
When compiled with OpenSSL &lt;= 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 &gt;= 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 &lt;= 1.1.1 code so that it behaves the same way
as the OpenSSL &gt;= 3.0 code currently does.

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

https://github.com/ruby/openssl/commit/7eb10f7b75
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When compiled with OpenSSL &lt;= 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 &gt;= 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 &lt;= 1.1.1 code so that it behaves the same way
as the OpenSSL &gt;= 3.0 code currently does.

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

https://github.com/ruby/openssl/commit/7eb10f7b75
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/openssl] Revert "Relax error message check for OpenSSL 3.1"</title>
<updated>2023-08-16T05:48:39+00:00</updated>
<author>
<name>Kazuki Yamaguchi</name>
<email>k@rhe.jp</email>
</author>
<published>2023-06-07T07:15:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4465941e68e076d3198a071600f1047b7a382e0b'/>
<id>4465941e68e076d3198a071600f1047b7a382e0b</id>
<content type='text'>
This reverts commit https://github.com/ruby/openssl/commit/fc4629d246f2.

The test case "test_connect_certificate_verify_failed_exception_message"
does want to check the reason behind a certificate verification failure
to be included in the exception message.

https://github.com/ruby/openssl/commit/c309745eb8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit https://github.com/ruby/openssl/commit/fc4629d246f2.

The test case "test_connect_certificate_verify_failed_exception_message"
does want to check the reason behind a certificate verification failure
to be included in the exception message.

https://github.com/ruby/openssl/commit/c309745eb8
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/openssl] Relax error message check for OpenSSL 3.1</title>
<updated>2023-03-16T08:17:46+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-03-15T11:34:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0b303c683007598a31f2cda3d512d981b278f8bd'/>
<id>0b303c683007598a31f2cda3d512d981b278f8bd</id>
<content type='text'>
A tentative measures fo https://github.com/ruby/openssl/issues/606.

With OpenSSL 3.1.0, the error message at connection using "self-signed
certificate" seems to return `SSL_R_TLSV1_ALERT_UNKNOWN_CA` instead of
`SSL_R_CERTIFICATE_VERIFY_FAILED`.

https://github.com/ruby/openssl/commit/fc4629d246
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A tentative measures fo https://github.com/ruby/openssl/issues/606.

With OpenSSL 3.1.0, the error message at connection using "self-signed
certificate" seems to return `SSL_R_TLSV1_ALERT_UNKNOWN_CA` instead of
`SSL_R_CERTIFICATE_VERIFY_FAILED`.

https://github.com/ruby/openssl/commit/fc4629d246
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/openssl] test/openssl/test_ssl.rb: do not run SSL tests if not available</title>
<updated>2022-12-23T00:39:15+00:00</updated>
<author>
<name>Kazuki Yamaguchi</name>
<email>k@rhe.jp</email>
</author>
<published>2022-12-22T19:06:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a4b4997c69437e9d2ba09629d72284a4fb9defc5'/>
<id>a4b4997c69437e9d2ba09629d72284a4fb9defc5</id>
<content type='text'>
https://github.com/ruby/openssl/commit/a3d230d4e0
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/openssl/commit/a3d230d4e0
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/openssl] ssl: disable NPN support on LibreSSL</title>
<updated>2022-12-23T00:39:15+00:00</updated>
<author>
<name>Kazuki Yamaguchi</name>
<email>k@rhe.jp</email>
</author>
<published>2022-10-17T08:33:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=dd6f3276e07f8f731a3bbcbdd58525ee6dd6581e'/>
<id>dd6f3276e07f8f731a3bbcbdd58525ee6dd6581e</id>
<content type='text'>
As noted in commit https://github.com/ruby/openssl/commit/a2ed156cc9f1 ("test/test_ssl: do not run NPN tests
for LibreSSL &gt;= 2.6.1", 2017-08-13), NPN is known not to work properly
on LibreSSL.

Disable NPN support on LibreSSL, whether OPENSSL_NO_NEXTPROTONEG is
defined or not.

NPN is less relevant today anyway. Let's also silence test suite when
it's not available.

https://github.com/ruby/openssl/commit/289f6e0e1f
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As noted in commit https://github.com/ruby/openssl/commit/a2ed156cc9f1 ("test/test_ssl: do not run NPN tests
for LibreSSL &gt;= 2.6.1", 2017-08-13), NPN is known not to work properly
on LibreSSL.

Disable NPN support on LibreSSL, whether OPENSSL_NO_NEXTPROTONEG is
defined or not.

NPN is less relevant today anyway. Let's also silence test suite when
it's not available.

https://github.com/ruby/openssl/commit/289f6e0e1f
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/openssl] Add support to SSL_CTX_set_keylog_callback</title>
<updated>2022-10-17T07:35:35+00:00</updated>
<author>
<name>Christophe De La Fuente</name>
<email>christophe_delafuente@rapid7.com</email>
</author>
<published>2022-08-29T18:15:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=17998ad3bb5864db38ba9e709ed7209da6189f0f'/>
<id>17998ad3bb5864db38ba9e709ed7209da6189f0f</id>
<content type='text'>
- This callback is invoked when TLS key material is generated or
  received, in order to allow applications to store this keying material
  for debugging purposes.
- It is invoked with an `SSLSocket` and a string containing the key
  material in the format used by NSS for its SSLKEYLOGFILE debugging
  output.
- This commit adds the Ruby binding `keylog_cb` and the related tests
- It is only compatible with OpenSSL &gt;= 1.1.1. Even if LibreSSL implements
  `SSL_CTX_set_keylog_callback()` from v3.4.2, it does nothing (see
  https://github.com/libressl-portable/openbsd/commit/648d39f0f035835d0653342d139883b9661e9cb6)

https://github.com/ruby/openssl/commit/3b63232cf1
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- This callback is invoked when TLS key material is generated or
  received, in order to allow applications to store this keying material
  for debugging purposes.
- It is invoked with an `SSLSocket` and a string containing the key
  material in the format used by NSS for its SSLKEYLOGFILE debugging
  output.
- This commit adds the Ruby binding `keylog_cb` and the related tests
- It is only compatible with OpenSSL &gt;= 1.1.1. Even if LibreSSL implements
  `SSL_CTX_set_keylog_callback()` from v3.4.2, it does nothing (see
  https://github.com/libressl-portable/openbsd/commit/648d39f0f035835d0653342d139883b9661e9cb6)

https://github.com/ruby/openssl/commit/3b63232cf1
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/openssl] ssl: enable generating keying material from SSL sessions</title>
<updated>2022-10-17T07:35:35+00:00</updated>
<author>
<name>madblobfish</name>
<email>-</email>
</author>
<published>2022-08-03T21:24:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=79543b9a530d85f0487583d96ad412f5e7683ffa'/>
<id>79543b9a530d85f0487583d96ad412f5e7683ffa</id>
<content type='text'>
Add OpenSSL::SSL::SSLSocket#export_keying_material to support RFC 5705

https://github.com/ruby/openssl/commit/65530b887e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add OpenSSL::SSL::SSLSocket#export_keying_material to support RFC 5705

https://github.com/ruby/openssl/commit/65530b887e
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/openssl] Skip a new test when old OpenSSL</title>
<updated>2022-07-09T06:26:32+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-07-09T05:29:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=949c3afb48d2afd02c2bfa569e29f6a3a48c1607'/>
<id>949c3afb48d2afd02c2bfa569e29f6a3a48c1607</id>
<content type='text'>
It does not raise an error when setting an invalid value to SSLContext
ciphers on Ubuntu 18.04.

https://github.com/ruby/openssl/commit/8c96a69b0d
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It does not raise an error when setting an invalid value to SSLContext
ciphers on Ubuntu 18.04.

https://github.com/ruby/openssl/commit/8c96a69b0d
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/openssl] Strip trailing spaces [ci skip]</title>
<updated>2022-07-08T15:39:18+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-07-08T14:20:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d77ebe8eeaad5d6e31a48eb1ecac2008fe0548f6'/>
<id>d77ebe8eeaad5d6e31a48eb1ecac2008fe0548f6</id>
<content type='text'>
https://github.com/ruby/openssl/commit/862d92de93
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/openssl/commit/862d92de93
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/openssl] Fix test of cipher name to pass in LibreSSL 3.4</title>
<updated>2022-07-08T14:18:18+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2022-03-25T20:50:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=def445303a93c69dd16a9b849b9171d4e89c6dc5'/>
<id>def445303a93c69dd16a9b849b9171d4e89c6dc5</id>
<content type='text'>
LibreSSL 3.5 switched the cipher naming to match OpenSSL.

https://github.com/ruby/openssl/commit/bf198278bd
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
LibreSSL 3.5 switched the cipher naming to match OpenSSL.

https://github.com/ruby/openssl/commit/bf198278bd
</pre>
</div>
</content>
</entry>
</feed>
