Handling for SSL and encoding