feat(GODT-2771): removed cert check and install on app startup on macOS.

This commit is contained in:
Xavier Michelon
2023-08-17 18:06:23 +02:00
parent 69190daf3f
commit 452d3068f0
9 changed files with 11 additions and 47 deletions

View File

@ -66,16 +66,6 @@ func (vault *Vault) SetBridgeTLSCertKey(cert, key []byte) error {
})
}
func (vault *Vault) GetCertsInstalled() bool {
return vault.getSafe().Certs.Installed
}
func (vault *Vault) SetCertsInstalled(installed bool) error {
return vault.modSafe(func(data *Data) {
data.Certs.Installed = installed
})
}
func readPEMCert(certPEMPath, keyPEMPath string) ([]byte, []byte, error) {
certPEM, err := os.ReadFile(filepath.Clean(certPEMPath))
if err != nil {

View File

@ -31,13 +31,4 @@ func TestVault_TLSCerts(t *testing.T) {
cert, key := s.GetBridgeTLSCert()
require.NotEmpty(t, cert)
require.NotEmpty(t, key)
// Check the certificates are not installed.
require.False(t, s.GetCertsInstalled())
// Install the certificates.
require.NoError(t, s.SetCertsInstalled(true))
// Check the certificates are installed.
require.True(t, s.GetCertsInstalled())
}

View File

@ -20,8 +20,7 @@ package vault
import "github.com/ProtonMail/proton-bridge/v3/internal/certs"
type Certs struct {
Bridge Cert
Installed bool
Bridge Cert
// If non-empty, the path to the PEM-encoded certificate file.
CustomCertPath string