Skip to content

Commit 308955c

Browse files
Kxkaclaude
andcommitted
fix: treat SSL cert error as warning instead of validation failure
Handle cURL error 60 (SSL certificate problem: unable to get local issuer certificate) by surfacing a warning message rather than blocking form submission. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 7ce4f39 commit 308955c

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/Form/TripleStoreIndexerConfigForm.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,15 @@ public function validateForm(array &$form, FormStateInterface $form_state) {
207207
}
208208
}
209209
catch (\Exception $e) {
210-
$form_state->setErrorByName("server_url",
211-
new FormattableMarkup('Your Server URL is not valid, please check it again. <strong>Error message:</strong> ' . $e->getMessage(), []));
210+
$errno = method_exists($e, 'getHandlerContext') ? ($e->getHandlerContext()['errno'] ?? 0) : 0;
211+
// Allow error code 'cURL error 60: SSL certificate problem: unable to get local issuer certificate'
212+
if ($errno === 60) {
213+
\Drupal::messenger()->addWarning(t('SSL certificate could not be verified.'));
214+
}
215+
else {
216+
$form_state->setErrorByName("server_url",
217+
new FormattableMarkup('Your Server URL is not valid, please check it again. <strong>Error message:</strong> ' . $e->getMessage(), []));
218+
}
212219
}
213220

214221
// Validate if entering a valid machine name of queue.

0 commit comments

Comments
 (0)