Safer token cache creation.
Fix strange SSL issue.