Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[postgresql] SSL/TLS support is broken since OpenSSL 3.2.0 #19851

Open
3 of 7 tasks
JelteF opened this issue Jan 24, 2024 · 1 comment
Open
3 of 7 tasks

[postgresql] SSL/TLS support is broken since OpenSSL 3.2.0 #19851

JelteF opened this issue Jan 24, 2024 · 1 comment
Labels

Comments

@JelteF
Copy link

JelteF commented Jan 24, 2024

Description / Steps to reproduce the issue

This problem was not happening before OpenSSL 3.2.0 was included in mingw

  1. Install mingw-w64-x86_64-postgresql
  2. Cretae database directory: initdb -D test
  3. change test/postgresql.conf by adding the following lines:
    ssl = on
    ssl_ca_file = 'server.crt'
    ssl_cert_file = 'server.crt'
    ssl_key_file = 'server.key'
  4. Create certificates:
    openssl req -new -newkey rsa:2048 -sha256 -days 365 -nodes -x509 -keyout test/server.key -out test/server.crt
  5. pg_ctl start -D test
  6. In another shell run psql 'sslmode=require'

Expected behavior

Connection succeeds and you can execute queries

Actual behavior

The Postgres server crashes while trying to accepting the connection:

2024-01-24 16:12:02.080 CET [31504] LOG:  could not accept SSL connection: An operation was attempted on something that is not a socket.

2024-01-24 16:12:04.872 CET [12812] LOG:  server process (PID 31504) was terminated by exception 0xC0000374
2024-01-24 16:12:04.872 CET [12812] HINT:  See C include file "ntstatus.h" for a description of the hexadecimal value.
2024-01-24 16:12:04.872 CET [12812] LOG:  terminating any other active server processes
2024-01-24 16:12:04.884 CET [12812] LOG:  all server processes terminated; reinitializing
2024-01-24 16:12:04.958 CET [27856] LOG:  database system was interrupted; last known up at 2024-01-24 16:11:59 CET
2024-01-24 16:12:05.882 CET [27856] LOG:  database system was not properly shut down; automatic recovery in progress
2024-01-24 16:12:05.888 CET [27856] LOG:  invalid record length at 0/14F1848: expected at least 24, got 0
2024-01-24 16:12:05.888 CET [27856] LOG:  redo is not required
2024-01-24 16:12:05.898 CET [36692] LOG:  checkpoint starting: end-of-recovery immediate wait
2024-01-24 16:12:05.911 CET [36692] LOG:  checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.004 s, sync=0.003 s, total=0.018 s; sync files=2, longest=0.002 s, average=0.002 s; distance=0 kB, estimate=0 kB; lsn=0/14F1848, redo lsn=0/14F1848
2024-01-24 16:12:05.951 CET [12812] LOG:  database system is ready to accept connections

Verification

Windows Version

MINGW64_NT-10.0-22621

MINGW environments affected

  • MINGW64
  • MINGW32
  • UCRT64
  • CLANG64
  • CLANG32
  • CLANGARM64

Are you willing to submit a PR?

no

@JelteF JelteF added the bug label Jan 24, 2024
@JelteF
Copy link
Author

JelteF commented Jan 24, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant