Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Can we get DEBUG loggin from the OpenSSL library?

Abierto
#800 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@ccutrer ya está trabajando en esto.

Desde el 17/11/2025.

  • #963 de @ccutrer — abierto

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
28/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
c, ruby

Línea de trabajo

Comienza con la salida de depuración de OpenSSL referenciada en crypto/x509/t_x509.c y compárala con el comportamiento de OpenSSL::debug de Ruby. Revisa el ejemplo de verify_callback y store_context y determina después si un indicador expuesto a Ruby puede proporcionar detalles equivalentes del certificado sin callbacks a nivel de aplicación. Se considera terminado cuando la interfaz propuesta y su comportamiento de registro esperado están definidos y probados.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Hi,

Problem

As a developer I would like to see (DEBUG) logging from OpenSSL. We have a Ruby application that connects to Amazon Cloudfront to retrieve a file. This runs through a network outside of our control containing NAT gateways, proxies, etc.

This works 99% of the time, but Intermittently we get a self signed certificate error:

OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 
peeraddr=18.66.171.65:443 state=error: certificate verify failed 
(self signed certificate in certificate chain))

But it doesn't show WHICH certificate (or subject, fignerprint, ...) is being seen.

Question / Request
Ideally we would have a ruby OpenSSL flag that instructs OpenSSL to do its (DEBUG) logging so we can get this information. I can see OpenSSL is logging the desired information in:

https://github.com/openssl/openssl/blob/6288aa440c1ba111eaf52cf79659a25329205022/crypto/x509/t_x509.c#L484-L501

Is it possible to get the Ruby app to log this information?

I have found OpenSSL::debug=true, but this only seems to trigger debug logging done in this Ruby Gem.

In java we have -Djava.net.debug=ssl, but I realize that is not using OpenSSL underneath.

Alternative
I have found a way to get Ruby to log the self-signed certificate that is being seen in Ruby via https://github.com/mislav/ssl-tools/blob/master/doctor.rb. Something along these lines, where the store_context contains the failed certificat:

  http.verify_callback = lambda { |verify_ok, store_context|
    if !verify_ok
      failed_cert = store_context.current_cert
      failed_cert_reason = "%d: %s" % [ store_context.error, store_context.error_string ]
    end
    verify_ok
  }

This is not ideal as it requires code changes in our Ruby apps, which is using httparty as a wrapper. Also we would be replicating logging that is already done by OpenSSL.

The fact that this SSL Docter script exists seems to confirm there is no Ruby OpenSSL::xxx flag to achieve this?

Would it be possible to implement such a flag? Is there an alternative way to achieve the same?

Lenguaje dominante
C
Estrellas
276
Forks
200
Merge medio
15 h 27 min
PR fusionados (30 d)
7

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de ruby/openssl

Todos los issues de ruby/openssl

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.