<p>I'm trying to set up an SSL certificate for Kong 2.7 installed in Kubernetes but I am not getting this to work as expected. I tried to follow this <a href="https://support.konghq.com/support/s/article/How-to-setup-Kong-to-serve-an-SSL-certificate-for-API-requests" rel="nofollow noreferrer">guide</a>. Even looking for additional help in <a href="https://discuss.konghq.com/t/adding-certificate-does-not-create-sni/2497" rel="nofollow noreferrer">discussion</a> .</p>
<pre><code>curl -X POST http://kong-admin:8001/certificates -F &quot;cert=kong.lan.pem&quot; -F &quot;key=kong.lan.key&quot; -F &quot;snis[0]=mydomain.net&quot;
</code></pre>
<p>This is my response:</p>
<pre><code>{
  &quot;fields&quot;: {
    &quot;cert&quot;: &quot;invalid certificate: x509.new: asn1/a_d2i_fp.c:197:error:0D06B08E:asn1 encoding routines:asn1_d2i_read_bio:not enough data&quot;,
    &quot;key&quot;: &quot;invalid key: pkey.new:load_key: asn1/a_d2i_fp.c:197:error:0D06B08E:asn1 encoding routines:asn1_d2i_read_bio:not enough data&quot;
  },
  &quot;message&quot;: &quot;2 schema violations (cert: invalid certificate: x509.new: asn1/a_d2i_fp.c:197:error:0D06B08E:asn1 encoding routines:asn1_d2i_read_bio:not enough data; key: invalid key: pkey.new:load_key: asn1/a_d2i_fp.c:197:error:0D06B08E:asn1 encoding routines:asn1_d2i_read_bio:not enough data)&quot;,
  &quot;name&quot;: &quot;schema violation&quot;,
  &quot;code&quot;: 2
}
</code></pre>
<p>Kong deployed with helm chart:</p>
<pre><code>$ helm repo add kong https://charts.konghq.com
$ helm repo update

$ helm install kong/kong --generate-name --set ingressController.enabled=true --set admin.enabled=True --set admin.http.enabled=True --set ingress.enabled=True --set proxy.ingress.enabled=True --set admin.type=LoadBalancer --set proxy.type=LoadBalancer
</code></pre>
<p>Does any of you know how to make this working or how to add tls.crt and tls.key into Kong Deployment?</p>

<p>You just miss the <code>@</code> on the curl command to upload files</p>
<pre><code>curl -X POST http://kong-admin:8001/certificates -F &quot;cert=@kong.lan.pem&quot; -F &quot;key=@kong.lan.key&quot; -F &quot;snis[0]=mydomain.net&quot;
</code></pre>
<pre><code>curl -X POST http://localhost:8001/certificates -F &quot;cert=kong.lan.pem&quot; -F &quot;key=kong.lan.key&quot; -F &quot;snis[0]=mydomain.net&quot;
</code></pre>
<p>will send</p>
<pre><code>POST /certificates HTTP/1.1
Host: localhost:8001
User-Agent: curl/7.68.0
Accept: */*
Content-Length: 363
Content-Type: multipart/form-data; boundary=------------------------d67ae21b533e5746

--------------------------d67ae21b533e5746
Content-Disposition: form-data; name=&quot;cert&quot;

kong.lan.pem
--------------------------d67ae21b533e5746
Content-Disposition: form-data; name=&quot;key&quot;

kong.lan.key
--------------------------d67ae21b533e5746
Content-Disposition: form-data; name=&quot;snis[0]&quot;

mydomain.net
--------------------------d67ae21b533e5746--
</code></pre>
<pre><code>echo &quot;toto&quot; &gt;| kong.lan.pem
curl -X POST http://localhost:8001/certificates -F &quot;cert=@kong.lan.pem&quot; -F &quot;key=kong.lan.key&quot; -F &quot;snis[0]=mydomain.net&quot;
</code></pre>
<p>will send</p>
<pre><code>POST /certificates HTTP/1.1
Host: localhost:8001
User-Agent: curl/7.68.0
Accept: */*
Content-Length: 421
Content-Type: multipart/form-data; boundary=------------------------973b3467e461334a

--------------------------973b3467e461334a
Content-Disposition: form-data; name=&quot;cert&quot;; filename=&quot;kong.lan.pem&quot;
Content-Type: application/octet-stream

toto

--------------------------973b3467e461334a
Content-Disposition: form-data; name=&quot;key&quot;

kong.lan.key
--------------------------973b3467e461334a
Content-Disposition: form-data; name=&quot;snis[0]&quot;

mydomain.net
--------------------------973b3467e461334a--
</code></pre>
