Tengo un desarrollo web sobre symfony 5.4 al que le he incorporado notifiaciones mediante Mercure hub. En una PC de desarrollo me funciona bien (wampserver y windows 10), sin embargo en otra laptop (wampserver y windows 10 también) que he reinstalado recientemente al enviarse un mensaje al hub de mercure obtengo el siguiente error, y no llegan los mensajes al cliente por supuesto:
[2022-04-19T11:56:08.121820-04:00] messenger.CRITICAL: Error thrown while handling message App\Message\NotificacionMessage. Removing from transport after 3 retries. Error: "Handling "App\Message\NotificacionMessage" failed: Failed to send an update." {"message":{"App\\Message\\NotificacionMessage":[]},"class":"App\\Message\\NotificacionMessage","retryCount":3,"error":"Handling \"App\\Message\\NotificacionMessage\" failed: Failed to send an update.","exception":"[object] (Symfony\\Component\\Messenger\\Exception\\HandlerFailedException(code: 0): Handling \"App\\Message\\NotificacionMessage\" failed: Failed to send an update. at C:\\wamp64\\www\\pami54.local\\vendor\\symfony\\messenger\\Middleware\\HandleMessageMiddleware.php:129)\n[previous exception] [object] (Symfony\\Component\\Mercure\\Exception\\RuntimeException(code: 0): Failed to send an update. at C:\\wamp64\\www\\pami54.local\\vendor\\symfony\\mercure\\src\\Hub.php:104)\n[previous exception] [object] (Symfony\\Component\\HttpClient\\Exception\\TransportException(code: 0): The request was not processed and can be safely retried at C:\\wamp64\\www\\pami54.local\\vendor\\symfony\\http-client\\Response\\CommonResponseTrait.php:148)\n[previous exception] [object] (Symfony\\Component\\HttpClient\\Exception\\TransportException(code: 0): The request was not processed and can be safely retried at C:\\wamp64\\www\\pami54.local\\vendor\\symfony\\http-client\\Chunk\\ErrorChunk.php:65)\n[previous exception] [object] (Amp\\Http\\Client\\Connection\\UnprocessedRequestException(code: 0): The request was not processed and can be safely retried at C:\\wamp64\\www\\pami54.local\\vendor\\amphp\\http-client\\src\\Connection\\DefaultConnectionFactory.php:161)\n[previous exception] [object] (Amp\\Http\\Client\\SocketException(code: 0): **Connection to 'pami54.local:8080' @ '127.0.0.1:8080' closed during TLS handshake** at C:\\wamp64\\www\\pami54.local\\vendor\\amphp\\http-client\\src\\Connection\\DefaultConnectionFactory.php:161)\n[previous exception] [object] (Amp\\Socket\\TlsException(code: 0): TLS negotiation failed: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:\nerror:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed at C:\\wamp64\\www\\pami54.local\\vendor\\amphp\\socket\\src\\Internal\\functions.php:134)"} []
En la laptop para que funcione he tenido que deshabilitar la verificación del certificado ssl:
framework:
http_client:
default_options:
verify_peer: false
Lo raro que encuentro es que en la otra computadora de desarrollo funciona sin tener que deshabilitar el verify_peer
.
NOTA: Los certificados que empleo son autofirmados en ambos servidores locales. En resumen, en una PC falla la verificación del certificado y en la otra no, y para mitigarlo he tenido que deshabilitar la verificación en el componente http_client de Symfony.