Ubuntu 23.04.
duplicati_2.0.7.1-1_all.deb
mono --version
Mono JIT compiler version 6.8.0.105 (Debian 6.8.0.105+dfsg-3.3 Wed Dec 14 17:29:20 UTC 2022)
/usr/bin/duplicati-server --webservice-interface=any --webservice-port=10443 --webservice-sslcertificatefile=/root/.config/Duplicati/keyStore.pfx --webservice-sslcertificatepassword=apassword
Setup with:
openssl req -x509 -newkey rsa:4096 -keyout myKey.pem -out cert.pem -days 3650 -nodes
openssl pkcs12 -export -out keyStore.pfx -inkey myKey.pem -in cert.pem
Verified with
openssl pkcs12 -in keyStore.pfx
which worked when I gave the password.
However, I get this error from duplicati:
/usr/bin/duplicati-server --webservice-interface=any --webservice-port=8443 --webservice-sslcertificatefile=/root/.config/Duplicati/keyStore.pfx --webservice-sslcertificatepassword=apassword
A serious error occurred in Duplicati: System.Exception: Unable to create SSL certificate using provided parameters. Exception detail: Unable to decode certificate. ---> System.Security.Cryptography.CryptographicException: Unable to decode certificate. ---> System.Security.Cryptography.CryptographicException: `MonoBtlsPkcs12.Import` failed.
at Mono.Btls.MonoBtlsObject.CheckError (System.Boolean ok, System.String callerName) [0x00022] in <a85c1a570f9a4f9f9c3d2cfa5504e34f>:0
at Mono.Btls.MonoBtlsObject.CheckError (System.Int32 ret, System.String callerName) [0x00000] in <a85c1a570f9a4f9f9c3d2cfa5504e34f>:0
at Mono.Btls.MonoBtlsPkcs12.Import (System.Byte[] buffer, Microsoft.Win32.SafeHandles.SafePasswordHandle password) [0x00033] in <a85c1a570f9a4f9f9c3d2cfa5504e34f>:0
at Mono.Btls.X509CertificateImplBtls.ImportPkcs12 (System.Byte[] data, Microsoft.Win32.SafeHandles.SafePasswordHandle password) [0x00054] in <a85c1a570f9a4f9f9c3d2cfa5504e34f>:0
at Mono.Btls.X509CertificateImplBtls..ctor (System.Byte[] data, Microsoft.Win32.SafeHandles.SafePasswordHandle password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags) [0x00061] in <a85c1a570f9a4f9f9c3d2cfa5504e34f>:0
--- End of inner exception stack trace ---
at Mono.Btls.X509CertificateImplBtls..ctor (System.Byte[] data, Microsoft.Win32.SafeHandles.SafePasswordHandle password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags) [0x0009b] in <a85c1a570f9a4f9f9c3d2cfa5504e34f>:0
at Mono.Btls.MonoBtlsProvider.GetNativeCertificate (System.Byte[] data, Microsoft.Win32.SafeHandles.SafePasswordHandle password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags flags) [0x00000] in <a85c1a570f9a4f9f9c3d2cfa5504e34f>:0
at Mono.Btls.X509PalImplBtls.Import (System.Byte[] data, Microsoft.Win32.SafeHandles.SafePasswordHandle password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags) [0x00006] in <a85c1a570f9a4f9f9c3d2cfa5504e34f>:0
at Mono.SystemCertificateProvider.Import (System.Byte[] data, Microsoft.Win32.SafeHandles.SafePasswordHandle password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags, Mono.CertificateImportFlags importFlags) [0x00021] in <a85c1a570f9a4f9f9c3d2cfa5504e34f>:0
at Mono.SystemCertificateProvider.Mono.ISystemCertificateProvider.Import (System.Byte[] data, Microsoft.Win32.SafeHandles.SafePasswordHandle password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags, Mono.CertificateImportFlags importFlags) [0x00000] in <a85c1a570f9a4f9f9c3d2cfa5504e34f>:0
at System.Security.Cryptography.X509Certificates.X509Helper.Import (System.Byte[] rawData, Microsoft.Win32.SafeHandles.SafePasswordHandle password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags) [0x00005] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.Security.Cryptography.X509Certificates.X509Certificate..ctor (System.String fileName, System.String password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags) [0x00041] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor (System.String fileName, System.String password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags) [0x00000] in <a85c1a570f9a4f9f9c3d2cfa5504e34f>:0
at Duplicati.Server.WebServer.Server..ctor (System.Collections.Generic.IDictionary`2[TKey,TValue] options) [0x001c6] in <30a34d71126b48248d040dda634ddad9>:0
--- End of inner exception stack trace ---
at Duplicati.Server.WebServer.Server..ctor (System.Collections.Generic.IDictionary`2[TKey,TValue] options) [0x001f2] in <30a34d71126b48248d040dda634ddad9>:0
at Duplicati.Server.Program.StartWebServer (System.Collections.Generic.Dictionary`2[TKey,TValue] commandlineOptions) [0x00000] in <30a34d71126b48248d040dda634ddad9>:0
at Duplicati.Server.Program.RealMain (System.String[] _args) [0x00227] in <30a34d71126b48248d040dda634ddad9>:0