<p>I'm trying to connect to a CloudSQL database from a container running in Kubernetes (not Google). I can connect using for instance IntelliJ, but Kubernetes refuses to connect</p>
<blockquote>
<p>failed to connect to <code>host=&lt;ip&gt; user=user database=db</code>: failed to
write startup message (x509: cannot validate certificate for 
because it doesn't contain any IP SANs)</p>
</blockquote>
<p>The message is connect in that the information is indeed missing in the certificate generated by Google.</p>
<p>Then how am I supposed to connect?</p>

Martin01478
<p>It's hard to say for sure because you haven't provided much information - you don't have any examples or information of how you are trying to connect other than &quot;from kubernetes&quot;, which makes it hard to diagnose what your specific problem is.</p>
<p>However - I'm going to make a couple of assumptions:</p>
<ol>
<li>Based on the error message, you are using Go</li>
<li>Based on a another comment, you are trying to use self-managed SSL certificates instead of the Cloud SQL proxy</li>
</ol>
<p>If that's the case, you may be running into this issue which requires you to use a custom verify method when using more recent Go versions: <a href="https://github.com/golang/go/issues/40748#issuecomment-673612108" rel="nofollow noreferrer">https://github.com/golang/go/issues/40748#issuecomment-673612108</a></p>
