forked from Silverfish/proton-bridge
feat(GODT-2771): removed cert check and install on app startup on macOS.
This commit is contained in:
@ -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 {
|
||||
|
||||
@ -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())
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user