Subject: [pgjdbc/pgjdbc] issue #3661: Why should PKCS12 name (or alias) be "user"?

From: "TyeolRik (@TyeolRik)" <[email-masked]>
Date: Fri, 13 Jun 2025 00:15:54 +0000

According to your [official document](https://jdbc.postgresql.org/documentation/use/),
PostgreSQL restricts name of PKCS#12 bag to be `user`.

> NOTE
The key file must be in PKCS-12 or in PKCS-8 DER format. A PEM key can be converted to DER format using the openssl command: openssl pkcs8 -topk8 -inform PEM -in postgresql.key -outform DER -out postgresql.pk8 -v1 PBE-MD5-DES When you create the key the alias or the name must be user. The test codes uses the following to create a .p12 key openssl pkcs12 -export -in $< -inkey $*.key -out $@ -name user -CAfile $(SERVER_CRT_DIR)root.crt -caname local -passout pass:$(P12_PASSWORD)

1. May I ask you WHY?
2. Do you have any plan to let us use not only `user` but also customized name like `tyeolrik_server` or something else?

Thank you for your help.

Sincerely yours,
Tyeolrik

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Fri, 13 Jun 2025 18:29:30 +0000

The reason is https://github.com/pgjdbc/pgjdbc/blob/bb911ff6caf9621f5dc06d9db4a0ab52a7fb1668/pgjdbc/src/main/java/org/postgresql/ssl/PKCS12KeyManager.java#L81

and currently have no plans to change it. PR's are welcome.

Dave

---

From: "TyeolRik (@TyeolRik)" <[email-masked]>
Date: Mon, 16 Jun 2025 00:57:13 +0000

Thank you for your kind instruction.

Well, I want to contribute with that. But not sure if I could do it perfectly HAHA

Have a nice day!