Getting SSL Certificate has expired error in Laravel app, but it should should be valid - laravel

I have an laravel app served with docker which until recently has been working fine, but since about 3 days ago it is not working. The problem is that I need to get data from a remote database, which is done with the guzzlehttp client used in the laravel framework. The SSL certificate is given automatically via. Let's Encrypt nginx proxy companion, and should be working, I have for example checked it on https://www.sslshopper.com/ssl-checker.html, and it says the certificate is valid, but I still get the curl error "cURL error 60: SSL certificate problem: certificate has expired (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)".
I have tried manually to point the guzzlehttp client to the cerficate file, and even downloaded the latest cacert file and used that, but no luck. Code looks something like this:
$this->client = new Client(["verify" => '/path-to-cert-file-in-docker-container.pem']);
Even more bizarre is that I have the same app running locally, and here I don't get the error if I use the certificate from the server or from https://curl.haxx.se/ca/cacert.pem mentioned above.
I should mention that we updated the let's encrypt container giving out the certificates on the server, so I run an older version locally. But the only thing that has changed is that we pulled a new image from docker, and I don't know what this should do to make a change here. I mention this since it seems that the error started after we updated let's encrypt, but I have been unable to find the connection.
Feel free to ask any questions or request code from the project.
Thanks in advance, Richard.

Related

SSL certificate on Heroku app not working

I recently downloaded an SSL certificate from zeroSSL.com and set it up in my Heroku CLI. Now the website still uses HTTP but it shows that an SSL certificate has been added on heroku.
If Heroku shows that the certificate was added, it should be available. Can you successfully browse to your site using HTTPS?
Note that Heroku doesn't redirect from HTTP to HTTPS for you. They recommend that you do that in application code:
Redirects need to be performed at the application level as the Heroku router does not provide this functionality. You should code the redirect logic into your application.
That page has several examples for how to redirect using common languages and frameworks. I'm not sure what you're using, but I suggest you start there.

Insecure connection on localhost

I am using Laravel 7 and utilizing Laravel socialite package for the first time for authenticating with facebook.
The problem is I am on localhost and when I am redirected to facebook I am getting error saying
Facebook has detected that XYZ isn't using a secure connection to transfer information.
Until XYZ updates its security settings, you won't be able to use Facebook to log in to it.
I tried to configure my xampp to run localhost on https by following these methods
https://stackoverflow.com/a/28658969/12168002
https://www.youtube.com/watch?v=Mig9YPNiUZI
but none of them worked for me.
I watched few socialite installation videos and noticed that none of them was having secure connection but still able to authenticate user successfully.
Please highlight the actual cause of me getting this error and how can I fix this?

Email verification failing

I have installed Parse Server directly from Heroku and mLab button and then Deploy to Heroku Button.
This is working fine, but now I need to set up email verification. I have installed Mailgun and Mailgun Email Verification addons directly from Heroku. Under Config vars the correct keys are all there, but I get the error
An appName, publicServerURL, and emailAdapter are required for
password reset and email verification functionality. (Code: 1,
Version: 1.17.2)
I was under the impression that when installing addons directly from Heroku, the settings was deployed automatically. Do I need to configure anything else after installing?
That message isn't from Mailgun; it's from the parse server itself.
You'll have to either customize the code or configure it properly. I don't think the example code gives you a way to configure appName, publicServerUrl, or emailAdapter from the environment so you'll probably have to deploy a customized instance that sets those variables. This example looks helpful.

getting sec_error_pkcs11_device_error while using https

Has anyone stumbled upon this error:
Error code: sec_error_pkcs11_device_error
I get it when I'm trying to access a web page where I should authenticate with my digital certificate (SSL). My certificate is not expired yet and now I'm getting this error.
Please anyone help.
I have got this error with Firefox browser while trying to use a certificate which was not trusted by the server (IIS 7.5) having to use it. Using a trusted certificate on server side solved the issue for me.
If you need more detailed instructions on how to handle certificates, I found following resources quite valuable:
https://www.sslshopper.com/article-how-to-create-a-self-signed-certificate-in-iis-7.html
https://www.sslshopper.com/move-or-copy-an-ssl-certificate-from-a-windows-server-to-another-windows-server.html

Securesocial with Twitter and Playframework 2.0 on Heroku

I have sucesfully installed securesocial in my play 2 app and I have it working for google and facebook. But i am having an issue with twitter
My conf file has the following
#
# Twitter
#
securesocial.twitter.requestTokenURL=https://twitter.com/oauth/request_token
securesocial.twitter.accessTokenURL=https://twitter.com/oauth/access_token
securesocial.twitter.authorizationURL=https://twitter.com/oauth/authenticate
securesocial.twitter.consumerKey=mykey
securesocial.twitter.consumerSecret=mysecret
but I am getting the following exception.
securesocial.provider.AuthenticationException: Authorization failed (server replied with a 401). This can happen if the consumer key was not correct or the signatures did not match.
My key and secret are the same as they are on my twitter API account app that I have created for this app. I have also included the website and the #anywhere domain from where this request is being called from.
Any ideas?
Make sure the time in your computer is properly set. Twitter will return that error if the local time in your computer is out of some offset compared to the time in their servers. Hope this helps.

Resources