PHP curl / libcurl error on subsequent requests

I’ve been getting the following error recently when making multiple calls using PHP curl (specifically Laravel’s artisan tinker)

To note the domain/IP has been anonymised, I am aware that the domain is – that wasn’t the actual host I was trying to connect to.

* Hostname was found in DNS cache
* Trying
* Connected to ( port 443 (#0)
* CAfile: none
 CApath: none
* A PKCS #11 module returned CKR_DEVICE_ERROR, indicating that a problem has occurred with the token or slot.
* Closing connection 0

Through plenty of Googlin’ and wasting quite honestly too much time on this I found the following command that fixes the issue. I would only advise running this on your dev machine just to get things working and not necessarily do it in production. Having said that I’ve only noticed this issue occurring in the tinker shell, I don’t believe it’s a problem for regular running webapps.


As mentioned in the comment that suggested this,

Once this is done, no more errors occur. That said, Mozilla clearly states it’s an error to do this but I couldn’t find an explanation as to why, which makes me a bit uneasy.

Your mileage may vary but if like me you’re just looking for a quick fix so you can get some darned dev work done, this’ll sort it for you. To revert the change you can use


Sign up for emails about the things

You're signing up to a rather infrequent mail list where I let you know about the new things going on.
All the messages have an unsub link in them and I'm never going to sell, trade, or otherwise hand over your contact information to anyone.
You'll not be signed up to any new lists either, because I hate it when places do that to me too