Re: Windows: openssl & gssapi dislike each other
Imran Zaheer <imran.zhir@gmail.com>
From: Imran Zaheer <imran.zhir@gmail.com>
To: Dave Page <dpage@pgadmin.org>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2024-06-08T10:22:39Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Move GSSAPI includes into its own header
- e92c0632c147 18.0 landed
-
Tighten test_predtest's input checks, and improve error messages.
- 00ac25a3c365 17.0 cited
-
Collation documentation fixes.
- 8ba34c698d19 17.0 cited
-
contrib/sslinfo needs a fix too to make hamerkop happy.
- 568620dfd691 15.0 cited
-
Second attempt to silence SSL compile failures on hamerkop.
- 1241fcbd7e64 15.0 cited
Attachments
- v01-0001-approach-01-Reorder-openssl-header.patch (application/octet-stream) patch v1-0001
I was able to reproduce the gssapi & openssl error on windows. I tried on PG16 with msvc build system and on PG17 with meson build system. The error was reproducible when enabling both openssl and gssapi from the configurations. Turns out that it was due to the conflicting macros. "be-secure-openssl.c" tries to prevent this conflict here [1]. But the error again appears when gssapi is enabled. The file "be-secure-openssl.c" fails to compile because it has a similar scenario as explained here [2]. The header libpq.h is indirectly including libpq-be.h which has a wrong order of including openssl headers. Header "gssapi.h" indirectly includes "wincrypt.h" and openssl header should be defined after gssapi includes. Now this can either be solved by just just undefine the macro defined by wincrypt.h as done here [3] ``` #ifdef X509_NAME #undef X509_NAME #endif ``` Or we should rearrange our headers. Openssl header should be at the bottom (after the gssapi includes). I am attaching the patch here in which I rearranged the openssl header in libpq-be.h [1]: https://github.com/postgres/postgres/blob/8ba34c698d19450ccae9a5aea59a6d0bc8b75c0e/src/backend/libpq/be-secure-openssl.c#L46 [2]: https://github.com/openssl/openssl/issues/10307#issuecomment-964155382 [3]: https://github.com/postgres/postgres/blob/00ac25a3c365004821e819653c3307acd3294818/contrib/sslinfo/sslinfo.c#L29 Thanks Imran Zaheer Bitnine