{"id":2165,"date":"2018-11-27T22:51:57","date_gmt":"2018-11-27T22:51:57","guid":{"rendered":"http:\/\/www.incredigeek.com\/home\/?p=2165"},"modified":"2018-11-27T22:51:57","modified_gmt":"2018-11-27T22:51:57","slug":"errors-renewing-lets-encrypt-certificate-for-unifi-video","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/errors-renewing-lets-encrypt-certificate-for-unifi-video\/","title":{"rendered":"Errors Renewing Lets Encrypt Certificate for UniFi-Video"},"content":{"rendered":"<p>Had an issue with the Lets Encrypt cert for a UniFi-Video server.\u00a0 When renewing the cert and reimporting it into the UniFi-Video keystore, the certification was showing out of date.<\/p>\n<p>Issue ended up being something with certbot.<\/p>\n<p>When certbot runs it generates a new cert.pem, chain.pem, fullchain.pem and privkey.pem and puts them in the &#8220;\/etc\/letsencrypt\/live\/unifi.domain.com\/&#8221; directory.<\/p>\n<p>The privkey.pem and cert.pem are used to create the keys.p12 file which gets imported into the UniFi-Video keystore.<\/p>\n<p>Apparently the .pem files in &#8220;\/etc\/letsencrypt\/live\/unifi.domain.com\/&#8221; are symbolic links to files in &#8220;\/etc\/letsencrypt\/archive\/unifi.domain.com\/&#8221;<\/p>\n<p>Upon inspection of the archive directory, multiple cert.pem and privkey.pem files were found with the names cert1.pem, cert2.pem, cert3.pem etc.\u00a0 Looking at the creation date of the file revealed the symbolic link was referring to an old &#8220;cert1.pem&#8221; file.<\/p>\n<p>Work around was to stop the unifi-video service and reimport the cert using the latest .pem files in the archive directory.<\/p>\n<pre>echo ubiquiti | openssl pkcs12 -export -inkey \/etc\/letsencrypt\/archive\/unifi.yourdomain.com\/privkey2.pem -in \/etc\/letsencrypt\/archive\/unifi.yourdomain.com\/cert2.pem -name airvision -out \/usr\/lib\/unifi-video\/data\/keys.p12 -password stdin\r\necho y | keytool -importkeystore -srckeystore \/etc\/letsencrypt\/archive\/unifi.yourdomain.com\/keys.p12 -srcstoretype pkcs12 -destkeystore \/usr\/lib\/unifi-video\/data\/keystore -storepass ubiquiti -srcstorepass ubiquiti<\/pre>\n<p>Remove the old ufv-truststore and start the service.<\/p>\n<pre>mv \/usr\/lib\/unifi-video\/data\/ufv-truststore{,.old}\r\nsystemctl start unifi-video<\/pre>\n<p>Worked like a charm.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Had an issue with the Lets Encrypt cert for a UniFi-Video server.\u00a0 When renewing the cert and reimporting it into the UniFi-Video keystore, the certification was showing out of date. Issue ended up being something with certbot. When certbot runs &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/errors-renewing-lets-encrypt-certificate-for-unifi-video\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[129,370],"tags":[358,507,359,509,508,7,356,131,132,188,265,532],"class_list":["post-2165","post","type-post","status-publish","format-standard","hentry","category-ubiquiti","category-unifi-video","tag-cert","tag-certbot","tag-certificate","tag-lets-encrypt","tag-letsencrypt","tag-linux-2","tag-ssl","tag-ubiquiti-2","tag-ubnt","tag-unifi","tag-unifi-video","tag-video"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/2165","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=2165"}],"version-history":[{"count":5,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/2165\/revisions"}],"predecessor-version":[{"id":3934,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/2165\/revisions\/3934"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=2165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=2165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=2165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}