Skip to content

Commit

Permalink
fix(bots): Allow bots with self-signed certificates
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Jun 7, 2024
1 parent 79a0109 commit 1ee07f2
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions lib/Service/BotService.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Http\Client\IClientService;
use OCP\Http\Client\IResponse;
use OCP\ICertificateManager;
use OCP\IConfig;
use OCP\ISession;
use OCP\IURLGenerator;
Expand All @@ -50,18 +51,19 @@

class BotService {
public function __construct(
protected BotServerMapper $botServerMapper,
protected BotServerMapper $botServerMapper,
protected BotConversationMapper $botConversationMapper,
protected IClientService $clientService,
protected IConfig $serverConfig,
protected IUserSession $userSession,
protected TalkSession $talkSession,
protected ISession $session,
protected ISecureRandom $secureRandom,
protected IURLGenerator $urlGenerator,
protected IFactory $l10nFactory,
protected ITimeFactory $timeFactory,
protected LoggerInterface $logger,
protected IClientService $clientService,
protected IConfig $serverConfig,
protected IUserSession $userSession,
protected TalkSession $talkSession,
protected ISession $session,
protected ISecureRandom $secureRandom,
protected IURLGenerator $urlGenerator,
protected IFactory $l10nFactory,
protected ITimeFactory $timeFactory,
protected LoggerInterface $logger,
protected ICertificateManager $certificateManager,
) {
}

Expand Down Expand Up @@ -173,9 +175,9 @@ protected function sendAsyncRequests(array $bots, array $body): void {
];

$data = [
'verify' => false,
'verify' => $this->certificateManager->getAbsoluteBundlePath(),
'nextcloud' => [
'allow_local_address' => true, // FIXME don't enforce
'allow_local_address' => true,
],
'headers' => $headers,
'timeout' => 5,
Expand Down

0 comments on commit 1ee07f2

Please sign in to comment.