Bitbucket login fails with x509: certificate signed by unknown authority

I have setup drone as described in the installation guideline using on-premise bitbucket server. The certificate I use is a “self-signed” certificate, signed by our internal CA. When trying to access drone UI I will get this error:

Login Failed. Post x509: certificate signed by unknown authority

What I am missing?

It looks like you are using a self-signed certificate for your Bitbucket Server. You need to provide the bitbucket server certificate to the Drone server, or you need to disable SSL verification of communication between Drone and Bitbucket Server using DRONE_STASH_SKIP_VERIFY=true

Thanks for the quick response. We actually added the certificates to the drone server - we are using kubernetes - but even after several re-deployments with the certificates mapped we continued to get the same error.
However the error eventually disappeared leaving us with only

Login Failed. Invalid Response

This however seems to be another problem with the Oauth

javax.servlet.ServletException: net.oauth.OAuthException: Signature length not correct: got 128 but was expecting 256

Regarding the Login Failed. Invalid Response

The problem is the length of the certificate. It looks like when entering a string wich is too long in the public key filed when setting up an incoming connection, then the string is shortened. Thus create a certifcate as suggestes here with a key length of 1024