Kais DevBlog

More or less structred thoughts

Creating and using a self-signed certificate for local testing

Posted in Structr by Kai on Nov 13, 2021

Sometimes developing functionality requires our installation to have a valid certificate. There are many reasons, for example some JavaScript APIs are only available on HTTPS (for example navigator.mediaDevices - see the full list). This works on localhost because some, if not all, browsers have an exception for localhost. But if we want to connect our mobile phone to that installation we will be getting errors if the connection is not secure.

Read more
Fix SSL connection problems to remote servers

Posted in Structr by Kai on Aug 06, 2021

If you get an error when making a connection to a remote server (for example using $.GET()) with the following error message it might look that there is something wrong or malicious going on with the SSL certificate of the remote server.

PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target

But maybe the SSL certificate is simply not included in the default java trust store. If you trust(!) the certificate there is a simple fix for this…

Read more