Fixes #585. Check node API certificate if using HTTPS.