{"id":787,"date":"2013-10-12T22:47:24","date_gmt":"2013-10-12T20:47:24","guid":{"rendered":"http:\/\/blog.schmoigl-online.de\/?p=787"},"modified":"2020-08-08T07:45:20","modified_gmt":"2020-08-08T05:45:20","slug":"openvpn-unsupported-certificate-purpose","status":"publish","type":"post","link":"http:\/\/blog.schmoigl-online.de\/?p=787","title":{"rendered":"OpenVPN Unsupported Certificate Purpose"},"content":{"rendered":"<p>Having set up a new OpenVPN system, I suddenly struggled with the following error message in my syslog:<\/p>\n<pre>VERIFY ERROR: depth=0, error=unsupported certificate purpose: \/C=....\n<\/pre>\n<p><!--more--><br \/>\nAt the first glance I thought that I had made a mistake when entering the common name. However, after some literature (originally this was written in the so-called &#8220;OpenVPN Howto&#8221;, which does not exist anymore; similar information is available to day at &#8220;<a href=\"https:\/\/openvpn.net\/vpn-server-resources\/installing-a-valid-ssl-web-certificate-in-access-server\/\">Installing a valid SSL Web certificate in Access Server<\/a>&#8220;, section &#8220;Certificate doesn\u2019t match private key, unsupported certificate purpose&#8221;), it became clear that OpenVPN does not perform any checks on the Common Names by default. You may activate such a feature by using the statement <code>tls-verify<\/code>. However, I did not make use of it.<br \/>\nAfter a long search, the Linode Forum Thread &#8220;<a href=\"https:\/\/forum.linode.com\/viewtopic.php?t=8099%3E\">OpenVPN help&#8230; verify error depth=0?<\/a>&#8221; brought the correct idea: As described in the section to prevent &#8220;Man-In-The-Middle&#8221; attack of the OpenVPN Howto, I had enabled my local Certification Authority (CA) to issue certificates with <em>nsCertType<\/em> set to <em>server<\/em>:<\/p>\n<pre>[...]\nnsCertType = server\nsubjectKeyIdentifier=hash\nauthorityKeyIdentifier=keyid,issuer:always\nextendedKeyUsage=serverAuth\nkeyUsage = digitalSignature, keyEncipherment\n<\/pre>\n<p>As I had automated the generation of keys via a small script, also the client certificate got created with this certificate type. However, OpenVPN apparently checks the usage type depending on the role your box is playing in the corresponding set up. This means:<\/p>\n<ul>\n<li>Use <em>nsCertType=server<\/em> certificates only for your OpenVPN server!<\/li>\n<li>Do not use <em>nsCertType=server<\/em> certificates for your OpenVPN clients!<\/li>\n<\/ul>\n<p>If you obey these rules, you will not have a problem with the error message on an &#8220;Unsupported Certificate Purpose&#8221; at server side.<\/p>\n<h3>Edit on 2020-08-08:<\/h3>\n<p>The nsCertType logic was <a href=\"https:\/\/community.openvpn.net\/openvpn\/wiki\/DeprecatedOptions?__cf_chl_jschl_tk__=7b8bff5ed6d316aadfa08d3274caf998e82f13f7-1596865020-0-AZrdWrRVoR1ey7TrT_yRa_AjPr2ZUfgvWntstG1E6GjMbYo5YcIpbiLqq00VE9vyrLUkN-TrEqEUo1kBmd3sLL-OPd-VaeohOq6jqrtjpHHpr3oZVDFRq2A2KTO3lNV3J-7BsRY1g3dF1nF_yJJjpZ2jk--73JlRezGDnlSwkvb0-Wo4GeAJIOtTpCX37Vbg8cIN1noTsQE-EgNT4wmpGpohlnnGf51sYGCpjDmP9GndHCsbUGZwbVc-A2E39pG1SzJ41PFPSkW2yVDgpjc4_XvAqVQBKgt4Ogta2_opkbyZujUJU3Io5q--9LQHyJetSA#Option:--ns-cert-type\">deprecated<\/a> by OpenVPN and will be removed soon. In essence the option should be replaced with &#8220;remote-cert-tls&#8221;, however, which also has implications to your certificate.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using certificates with nsCertType=server for OpenVPN clients will result in the error message &#8220;Unsupported Certificate Purpose&#8221;.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[],"class_list":["post-787","post","type-post","status-publish","format-standard","hentry","category-openvpn"],"_links":{"self":[{"href":"http:\/\/blog.schmoigl-online.de\/index.php?rest_route=\/wp\/v2\/posts\/787","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.schmoigl-online.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.schmoigl-online.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.schmoigl-online.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.schmoigl-online.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=787"}],"version-history":[{"count":4,"href":"http:\/\/blog.schmoigl-online.de\/index.php?rest_route=\/wp\/v2\/posts\/787\/revisions"}],"predecessor-version":[{"id":1418,"href":"http:\/\/blog.schmoigl-online.de\/index.php?rest_route=\/wp\/v2\/posts\/787\/revisions\/1418"}],"wp:attachment":[{"href":"http:\/\/blog.schmoigl-online.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=787"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.schmoigl-online.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=787"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.schmoigl-online.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=787"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}