Skip to content

fix: enable TLS certificate verification for SDK requests - #42

Merged
h2rd merged 1 commit into
masterfrom
issue/tls-verification
Oct 12, 2026
Merged

h2rd merged 1 commit into
masterfrom
issue/tls-verification

Conversation

@h2rd

@h2rd h2rd commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • The SDK turned off TLS certificate checks, so anyone on the network path could present any certificate and read the api_key from the request URL.
  • Both checks are now on. A bad, expired or wrong-name certificate is rejected before any HTTP request is sent.

Technical details

  • Route4Me::makeRequst(): CURLOPT_SSL_VERIFYPEER => true and CURLOPT_SSL_VERIFYHOST => 2. Both were false before. These match curl's defaults, so systems with a working CA bundle see no change.
  • CurlHttpClient::init(): the same two options. It set CURLOPT_SSL_VERIFYPEER to 0 before.
  • makeRequst(): when curl fails with no response, ApiError now carries curl_error(). It was an empty message before, so a rejected certificate shows its reason, for example "self-signed certificate".
  • Endpoint::TELEMATICS_VENDORS: http:// changed to https://. The host currently answers with a 301, which CURLOPT_FOLLOWLOCATION follows.
  • Backward compatibility: callers on hosts without a CA bundle (some Windows PHP installs) now get an ApiError instead of an unverified connection. They need to set curl.cainfo in php.ini.

🤖 Generated with Claude Code

makeRequst() and CurlHttpClient disabled peer and host verification,
so an on-path attacker with any certificate could read the api_key
from the request URL. Turn both checks on, surface the curl error on
connection failures, and call the telematics vendors endpoint over
HTTPS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@h2rd
h2rd force-pushed the issue/tls-verification branch from 5a6b076 to f163532 Compare October 12, 2026 17:53
@h2rd
h2rd merged commit f8eeede into master Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant