I read this: Custom SSL certs for snapd to the snap store communication
And I wanted to add HTTP Debugger certificate to monitor my snap connections, to see what it does, for example to find direct url of one snap which is 300 MB so I can download it manually with resume support or better software. I use HTTP Debugger in Windows 10 and I use Ubuntu on VMWare player. I already succeeded adding the same certificate to system by adding it to dir /usr/local/share/ca-certificates/ using command: sudo update-ca-certificates
I exported certificate from Windows 10 as base64 encoded, the same format FIrefox uses on Ubuntu in some folder where it keeps certs. I tried renaming both to crt and cer.
Command used and result:
nijaz@nijaz-virtual-machine:~$ sudo snap set system store-certs.cert1="$(cat /mnt/hgfs/LinuxAnalysis/httpdebugger-cer.cer)"
bash: warning: command substitution: ignored null byte in input
[sudo] password for nijaz:
error: cannot perform the following tasks:
- Run configure hook of "core" snap (run hook "configure": cannot decode pem certificate "cert1")
Here is exact content of cert, in case you wanna try:
-----BEGIN CERTIFICATE-----
MIIDIjCCAgqgAwIBAgIRANwOmFo7+yLGYf1CxLdbqN8wDQYJKoZIhvcNAQELBQAw
OTELMAkGA1UEBhMCRU4xKjAoBgNVBAMMIUhUVFAgREVCVUdHRVIgQ0EgZm9yIERF
QlVHIE9OTFkgMjAgFw0wMTA1MTgxMjU1MDlaGA8yMDYxMDUwMzEyNTUwOVowOTEL
MAkGA1UEBhMCRU4xKjAoBgNVBAMMIUhUVFAgREVCVUdHRVIgQ0EgZm9yIERFQlVH
IE9OTFkgMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANEC+sWUcfJF
ToC57ghh7WvGLDrfx5lIp0yrZDEiHXtx32GqAFokXmwzJ82iDVwIrbDSIf62NBQ5
zt5NENdk5oi36rwYlDNWMTEs8rtwGMWJuiZRMaleVPVjL1Ecf2T4cCWiGw83qvNy
WDAd4OaYV0DCvBe3YPR7bOKrznwEv/Eycp+NiBOkpidYnyrdb/A4gsMBuEKYjIQ3
z5lrrEuAUrpJADf2jlxTTJ7ede1Dmyga1yzoOeAuc0ZLEJKaqNG2cwK+tOZ9W7OL
/KmHgY/+FhMO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