Skip to content

Commit b37a7f0

Browse files
Add --curl-debug option for verbose HTTP debugging
This commit adds a new global --curl-debug CLI option that enables verbose cURL output to help troubleshoot TLS and connection issues. When --curl-debug is specified, detailed HTTP transaction information is displayed including: - Connection establishment details - TLS handshake information - HTTP headers and progress - Transfer details This is particularly useful for diagnosing customer issues related to: - Misconfigured CA certificates - Incorrect system clocks causing TLS validation failures - Network connectivity problems - Certificate verification errors The implementation leverages Guzzle's built-in debug functionality which uses cURL's CURLOPT_VERBOSE option under the hood.
1 parent 48dd6a5 commit b37a7f0

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/Request/Request.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,14 @@ private function getClient($base_uri = null): ClientInterface
155155
'handler' => $stack,
156156
];
157157

158+
// Enable cURL debug output if --curl-debug option is set
159+
if ($this->getContainer()->has('input')) {
160+
$input = $this->getContainer()->get('input');
161+
if ($input->hasOption('curl-debug') && $input->getOption('curl-debug')) {
162+
$params['debug'] = true;
163+
}
164+
}
165+
158166
$host_cert = $config->get('host_cert');
159167
if ($host_cert !== null) {
160168
$params[RequestOptions::CERT] = $host_cert;

src/Terminus.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ private function addDefaultArgumentsAndOptions(Application $app)
178178
$app->getDefinition()->addOption(
179179
new InputOption('--yes', '-y', InputOption::VALUE_NONE, 'Answer all confirmations with "yes"')
180180
);
181+
$app->getDefinition()->addOption(
182+
new InputOption('--curl-debug', null, InputOption::VALUE_NONE, 'Enable verbose cURL debug output for troubleshooting TLS and connection issues')
183+
);
181184
}
182185

183186
/**

0 commit comments

Comments
 (0)