Issues solved by gerthomas
Some checks failed
Tests / Lint (push) Has been cancelled
Tests / Run Tests (push) Has been cancelled
Build and Push Docker Image / build-and-push (push) Has been cancelled
Tests / Build (push) Has been cancelled

An "incorrect password" error is received when importing the generated Client .p12 mTLS certificate on iOS.

My understanding is this is frequently caused by incompatible encryption methods between modern certificate generation tools (like OpenSSL 3.x and in this case SSLMate’s go-pkcs12 Modern) and iOS’s older security standards.

The relevant portion of code is below:

// Generate PKCS#12 (.p12) file
p12Data, err := pkcs12.Modern.Encode(clientKey, clientCert, []*x509.Certificate{caCert}, req.P12Password)
if err != nil {
	return nil, fmt.Errorf("failed to generate PKCS#12: %w", err)
}
If this is changed to:

// Generate PKCS#12 (.p12) file
p12Data, err := pkcs12.Legacy.Encode(clientKey, clientCert, []*x509.Certificate{caCert}, req.P12Password)
if err != nil {
	return nil, fmt.Errorf("failed to generate PKCS#12: %w", err)
}
The generated client certificates can be imported by iOS devices.

I have forked the repo and tested it (it works) but would not advocate this change. An option to select legacy (only when required) would be preferable. Unfortunately the changes to the database where certs and keys are stored and the UI to make Legacy selectable are beyond me.
44a80ab152

Co-Authored-By: gerthomas <34512947+gerthomas@users.noreply.github.com>
This commit is contained in:
hhftechnologies 2026-03-01 14:29:53 +05:30
parent 90a75b5a93
commit 8f2c5861dc
3 changed files with 4 additions and 58 deletions

4
.gitignore vendored
View file

@ -35,6 +35,10 @@ go.work
ui/node_modules/
ui/dist/
# Compiled vite config artifacts
ui/vite.config.js
ui/vite.config.d.ts
# SQLite database
*.db

2
ui/vite.config.d.ts vendored
View file

@ -1,2 +0,0 @@
declare const _default: import("vite").UserConfig;
export default _default;

View file

@ -1,56 +0,0 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
server: {
port: 3000,
proxy: {
'/api': {
target: 'http://localhost:3456',
changeOrigin: true,
},
'/health': {
target: 'http://localhost:3456',
changeOrigin: true,
},
},
},
build: {
outDir: 'dist',
sourcemap: true,
rollupOptions: {
output: {
manualChunks: {
'react-vendor': ['react', 'react-dom'],
'ui-vendor': [
'@radix-ui/react-dialog',
'@radix-ui/react-dropdown-menu',
'@radix-ui/react-select',
'@radix-ui/react-tabs',
'@radix-ui/react-tooltip',
],
'query-vendor': ['@tanstack/react-query'],
'form-vendor': ['react-hook-form', '@hookform/resolvers', 'zod'],
'state-vendor': ['zustand'],
},
},
},
chunkSizeWarningLimit: 1000,
},
optimizeDeps: {
include: [
'react',
'react-dom',
'zustand',
'@tanstack/react-query',
'lucide-react',
],
},
});