Skip to content

Commit 70a94c2

Browse files
committed
feat: add client certificate management for mTLS authentication
1 parent cb58952 commit 70a94c2

4 files changed

Lines changed: 12 additions & 3 deletions

File tree

src/main/java/com/laker/postman/panel/topmenu/setting/ClientCertificateSettingsPanel.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ private JPanel createFormPanel() {
360360
// 端口
361361
addFormRow(formPanel, gbc, row++,
362362
I18nUtil.getMessage(MessageKeys.CERT_PORT) + ":",
363-
portField = createTextField(10, I18nUtil.getMessage(MessageKeys.CERT_PORT_ALL)),
363+
portField = createTextField(10, I18nUtil.getMessage(MessageKeys.CERT_PORT_PLACEHOLDER)),
364364
false);
365365

366366
// 证书类型
@@ -392,7 +392,7 @@ private JPanel createFormPanel() {
392392
gbc.gridx = 1;
393393
gbc.weightx = 1.0;
394394
gbc.gridwidth = 1;
395-
certPathField = createTextField(28, "");
395+
certPathField = createTextField(28, I18nUtil.getMessage(MessageKeys.CERT_CERT_PATH_PLACEHOLDER));
396396
formPanel.add(certPathField, gbc);
397397

398398
gbc.gridx = 2;
@@ -414,7 +414,7 @@ private JPanel createFormPanel() {
414414
gbc.gridx = 1;
415415
gbc.weightx = 1.0;
416416
gbc.gridwidth = 1;
417-
keyPathField = createTextField(28, "");
417+
keyPathField = createTextField(28, I18nUtil.getMessage(MessageKeys.CERT_KEY_PATH_PLACEHOLDER));
418418
formPanel.add(keyPathField, gbc);
419419

420420
gbc.gridx = 2;

src/main/java/com/laker/postman/util/MessageKeys.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,8 +1319,11 @@ private MessageKeys() {
13191319
public static final String CERT_TYPE_PFX = "cert.type.pfx";
13201320
public static final String CERT_TYPE_PEM = "cert.type.pem";
13211321
public static final String CERT_PORT_ALL = "cert.port.all";
1322+
public static final String CERT_PORT_PLACEHOLDER = "cert.port.placeholder";
13221323
public static final String CERT_HOST_PLACEHOLDER = "cert.host.placeholder";
13231324
public static final String CERT_NAME_PLACEHOLDER = "cert.name.placeholder";
1325+
public static final String CERT_CERT_PATH_PLACEHOLDER = "cert.cert_path.placeholder";
1326+
public static final String CERT_KEY_PATH_PLACEHOLDER = "cert.key_path.placeholder";
13241327
public static final String CERT_VALIDATION_HOST_REQUIRED = "cert.validation.host_required";
13251328
public static final String CERT_VALIDATION_CERT_REQUIRED = "cert.validation.cert_required";
13261329
public static final String CERT_VALIDATION_KEY_REQUIRED = "cert.validation.key_required";

src/main/resources/messages_en.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,8 +767,11 @@ cert.select_file=Select File
767767
cert.type.pfx=PFX/P12
768768
cert.type.pem=PEM
769769
cert.port.all=All Ports
770+
cert.port.placeholder=Port number, leave empty or 0 for all ports
770771
cert.host.placeholder=e.g., api.example.com or *.example.com
771772
cert.name.placeholder=Optional: Give this certificate configuration a name
773+
cert.cert_path.placeholder=Select certificate file (.pfx, .p12, .pem, .crt)
774+
cert.key_path.placeholder=Select private key file (.key, .pem)
772775
cert.validation.host_required=Host cannot be empty
773776
cert.validation.cert_required=Certificate file cannot be empty
774777
cert.validation.key_required=Private key file is required for PEM format

src/main/resources/messages_zh.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,8 +1315,11 @@ cert.select_file=选择文件
13151315
cert.type.pfx=PFX/P12
13161316
cert.type.pem=PEM
13171317
cert.port.all=所有端口
1318+
cert.port.placeholder=端口号,留空或0表示所有端口
13181319
cert.host.placeholder=例如: api.example.com 或 *.example.com
13191320
cert.name.placeholder=可选:为此证书配置命名
1321+
cert.cert_path.placeholder=选择证书文件 (.pfx, .p12, .pem, .crt)
1322+
cert.key_path.placeholder=选择私钥文件 (.key, .pem)
13201323
cert.validation.host_required=主机名不能为空
13211324
cert.validation.cert_required=证书文件不能为空
13221325
cert.validation.key_required=PEM格式需要私钥文件

0 commit comments

Comments
 (0)