Fix SSL request

This commit is contained in:
2026-06-25 13:40:34 +02:00
parent 3f6a469e96
commit 35701ad7e6
3 changed files with 30 additions and 3 deletions

View File

@@ -24,7 +24,7 @@ class XenforoApiService {
*/
private function get(string $endpoint, ?int $customUserId = null ): mixed
{
$response = Http::timeout(30)->withHeaders([
$response = Http::timeout(30)->withOptions(['verify' => false])->withHeaders([
'XF-Api-Key' => $this->apiKey,
'XF-Api-User' => $customUserId ?? $this->superUserId,
])->get("{$this->apiUrl}/{$endpoint}");
@@ -39,7 +39,7 @@ class XenforoApiService {
private function post(string $endpoint, ?int $customUserId = null, array $data = [] ): mixed
{
$response = Http::timeout(30)->withHeaders([
$response = Http::timeout(30)->withOptions(['verify' => false])->withHeaders([
'XF-Api-Key' => $this->apiKey,
'XF-Api-User' => $customUserId ?? $this->superUserId,
])->post("{$this->apiUrl}/{$endpoint}", $data);
@@ -54,7 +54,7 @@ class XenforoApiService {
private function delete(string $endpoint, ?int $customUserId = null, array $data = [] ): mixed
{
$response = Http::timeout(30)->withHeaders([
$response = Http::timeout(30)->withOptions(['verify' => false])->withHeaders([
'XF-Api-Key' => $this->apiKey,
'XF-Api-User' => $customUserId ?? $this->superUserId,
])->delete("{$this->apiUrl}/{$endpoint}", $data);