소스 검색

Add OPENID_HTTP_VERIFY_SSL_PEER env var to disable ssl cert verification
Closes #479

Bubka 1 개월 전
부모
커밋
44f94d6770
5개의 변경된 파일15개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 0
      .env.example
  2. 4 0
      Dockerfile
  3. 1 1
      bootstrap/app.php
  4. 3 0
      config/services.php
  5. 4 0
      docker/docker-compose.yml

+ 3 - 0
.env.example

@@ -252,6 +252,9 @@ WEBAUTHN_USER_VERIFICATION=preferred
 # OPENID_USERINFO_URL=
 # OPENID_CLIENT_ID=
 # OPENID_CLIENT_SECRET=
+# OPENID_HTTP_VERIFY_SSL_PEER=true
+# Can also be the path to a custom certificate on disk, i.e
+# OPENID_HTTP_VERIFY_SSL_PEER=/path/to/cert.pem
 
 # GITHUB_CLIENT_ID=
 # GITHUB_CLIENT_SECRET=

+ 4 - 0
Dockerfile

@@ -227,6 +227,10 @@ ENV \
     # OPENID_USERINFO_URL= \
     # OPENID_CLIENT_ID= \
     # OPENID_CLIENT_SECRET= \
+    # OPENID_HTTP_VERIFY_SSL_PEER=true \
+    # Can also be the path to a custom certificate on disk, i.e
+    # OPENID_HTTP_VERIFY_SSL_PEER=/path/to/cert.pem \
+    #
     # GITHUB_CLIENT_ID= \
     # GITHUB_CLIENT_SECRET= \
     # Use this setting to declare trusted proxied.

+ 1 - 1
bootstrap/app.php

@@ -15,7 +15,7 @@ if (! function_exists('envUnlessEmpty')) {
     /**
      * @return mixed|null
      */
-    function envUnlessEmpty(string $key, string|int|bool|float|null $default = null)
+    function envUnlessEmpty(string $key, string|int|bool|float|array|null $default = null)
     {
         $result = env($key, $default);
         if ('' === $result) {

+ 3 - 0
config/services.php

@@ -28,6 +28,9 @@ return [
         'client_id' => env('OPENID_CLIENT_ID'),
         'client_secret' => env('OPENID_CLIENT_SECRET'),
         'redirect' => env('APP_URL') . '/socialite/callback/openid',
+        'guzzle' => [
+            'verify' => envUnlessEmpty('OPENID_HTTP_VERIFY_SSL_PEER', true), // https://docs.guzzlephp.org/en/stable/request-options.html#verify
+        ]
     ],
 
     'github' => [

+ 4 - 0
docker/docker-compose.yml

@@ -124,6 +124,10 @@ services:
       # - OPENID_USERINFO_URL=
       # - OPENID_CLIENT_ID=
       # - OPENID_CLIENT_SECRET=
+      # - OPENID_HTTP_VERIFY_SSL_PEER=true
+      # Can also be the path to a custom certificate on disk, i.e
+      # - OPENID_HTTP_VERIFY_SSL_PEER=/path/to/cert.pem
+      #
       # - GITHUB_CLIENT_ID=
       # - GITHUB_CLIENT_SECRET=
       # Use this setting to declare trusted proxied.