exception handling and ignore bad certificates