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


Fancy an email update instead of having to pop back here every time?

Heya! I’m Cohan and I make websites. I also administer Linux servers and do other nerdy good stuff like that.
My real love is writing though, this here’s my outlet for that.
A picture of me.