Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite76d06d

Browse files
committed
Don't share SSL_CTX between libpq connections.
There were several issues with the old coding:1. There was a race condition, if two threads opened a connection at the same time. We used a mutex around SSL_CTX_* calls, but that was not enough, e.g. if one thread SSL_CTX_load_verify_locations() with one path, and another thread set it with a different path, before the first thread got to establish the connection.2. Opening two different connections, with different sslrootcert settings, seemed to fail outright with "SSL error: block type is not 01". Not sure why.3. We created the SSL object, before calling SSL_CTX_load_verify_locations and SSL_CTX_use_certificate_chain_file on the SSL context. That was wrong, because the options set on the SSL context are propagated to the SSL object, when the SSL object is created. If they are set after the SSL object has already been created, they won't take effect until the next connection. (This is bug #14329)At least some of these could've been fixed while still using a sharedcontext, but it would've been more complicated and error-prone. To keepthings simple, let's just use a separate SSL context for each connection,and accept the overhead.Backpatch to all supported versions.Report, analysis and test case by Kacper Zuk.Discussion: <20160920101051.1355.79453@wrigleys.postgresql.org>
1 parent14e2d9a commite76d06d

File tree

1 file changed

+163
-230
lines changed

1 file changed

+163
-230
lines changed

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp