Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Authenticating Users with Google Cloud Identity

    Scheduled Pinned Locked Moved General pfSense Questions
    103 Posts 3 Posters 9.5k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      leonida368 @stephenw10
      last edited by

      I understand, but is the procedure with which I pasted the certificate file correct?

      1 Reply Last reply Reply Quote 0
      • stephenw10S
        stephenw10 Netgate Administrator
        last edited by

        Yes, that's fine for importing a cert.

        L 1 Reply Last reply Reply Quote 0
        • L
          leonida368 @stephenw10
          last edited by

          Hi @stephenw10 , Where can I see the cause of Stunnel not starting?

          1 Reply Last reply Reply Quote 0
          • stephenw10S
            stephenw10 Netgate Administrator
            last edited by

            Well as I suggested I would try to start the service then check the logs.

            L 1 Reply Last reply Reply Quote 0
            • L
              leonida368 @stephenw10
              last edited by

              @stephenw10 said in Authenticating Users with Google Cloud Identity:

              Well as I suggested I would try to start the service then check the logs.

              Reply

              I find Stunnel only in System/General and it only affects the installation phase. Then I don't see it anywhere else

              1 Reply Last reply Reply Quote 0
              • stephenw10S
                stephenw10 Netgate Administrator
                last edited by

                How do you have it configured? What happens when you try to start it?

                L 1 Reply Last reply Reply Quote 0
                • L
                  leonida368 @stephenw10
                  last edited by

                  3a9b3cfe-0072-446a-ab1e-f7bd7dfc772a-image.png

                  L 1 Reply Last reply Reply Quote 0
                  • L
                    leonida368 @leonida368
                    last edited by

                    both in Services/Stunnel and in Status/Services if I click on the arrow to start it after a while it returns again

                    1 Reply Last reply Reply Quote 0
                    • stephenw10S
                      stephenw10 Netgate Administrator
                      last edited by

                      @leonida368 said in Authenticating Users with Google Cloud Identity:

                      https://docs.netgate.com/pfsense/en/latest/recipes/auth-google-gsuite.html

                      Ok so reviewing that it is a cert and not a CA cert. So did you import it with the key as described there?

                      L 1 Reply Last reply Reply Quote 0
                      • L
                        leonida368 @stephenw10
                        last edited by

                        yes

                        1 Reply Last reply Reply Quote 0
                        • stephenw10S
                          stephenw10 Netgate Administrator
                          last edited by

                          Try setting logging to DEBUG, see if that generates something when it tries to start.

                          L 1 Reply Last reply Reply Quote 0
                          • L
                            leonida368 @stephenw10
                            last edited by

                            unfortunately nothing

                            1 Reply Last reply Reply Quote 0
                            • stephenw10S
                              stephenw10 Netgate Administrator
                              last edited by

                              Does it start correctly if you don't set a cert at all?

                              Otherwise check if you have something else listening on port 1636 already for some reason.

                              L 1 Reply Last reply Reply Quote 0
                              • L
                                leonida368 @stephenw10
                                last edited by

                                hi, the Certificate field cannot remain empty

                                L stephenw10S 2 Replies Last reply Reply Quote 0
                                • L
                                  leonida368 @leonida368
                                  last edited by

                                  Up until last year I used Packetfence to do this. Even if it is a different product (it is a nac not a firewall) for better or worse the authentication with Google Workspace worked, but this involved the simultaneous presence of Packetfence for authentication and PFSense as a firewall and furthermore Packetfence registers a device with the user who authenticates and then the captive portal no longer appears on that device. Instead I would have liked to do everything with PFsense but I find it hard....

                                  1 Reply Last reply Reply Quote 0
                                  • stephenw10S
                                    stephenw10 Netgate Administrator @leonida368
                                    last edited by

                                    @leonida368 said in Authenticating Users with Google Cloud Identity:

                                    the Certificate field cannot remain empty

                                    It throws an error when you try?

                                    You have to have a client cert for Google Auth to accept it but Stunnel should start OK without a cert defined there. If it does then we know the problem is with the certificate.

                                    1 Reply Last reply Reply Quote 0
                                    • stephenw10S
                                      stephenw10 Netgate Administrator
                                      last edited by

                                      Like:
                                      Screenshot from 2024-05-21 12-57-33.png

                                      L 1 Reply Last reply Reply Quote 1
                                      • L
                                        leonida368 @stephenw10
                                        last edited by

                                        it's a box where you have to choose something but if I choose Default I have a view like yours i.e. the Certificate field is empty. However, even in this way the service does not start

                                        1 Reply Last reply Reply Quote 0
                                        • stephenw10S
                                          stephenw10 Netgate Administrator
                                          last edited by

                                          Ok so not a certificate issue.

                                          Do you have other STunnel entries that might have misconfig?

                                          Do you have some other service already listening on port 1636?

                                          What happens if you just try to run the command at the CLI:

                                          [24.03-RELEASE][admin@4200.stevew.lan]/root: stunnel
                                          [ ] Initializing inetd mode configuration
                                          [ ] Clients allowed=54725
                                          [.] stunnel 5.71 on amd64-portbld-freebsd15.0 platform
                                          [.] Compiled/running with OpenSSL 3.0.13 24 Oct 2023
                                          [.] Threading:PTHREAD Sockets:POLL,IPv6 TLS:ENGINE,OCSP,PSK,SNI
                                          [ ] errno: (* __error())
                                          [ ] Initializing inetd mode configuration
                                          [.] Reading configuration from file /usr/local/etc/stunnel/stunnel.conf
                                          [.] UTF-8 byte order mark not detected
                                          [ ] Compression disabled
                                          [ ] No PRNG seeding was required
                                          [ ] Initializing service [Google Auth Test]
                                          [ ] Initializing context [Google Auth Test]
                                          [ ] stunnel default security level set: 2
                                          [ ] Ciphers: HIGH:!aNULL:!SSLv2:!DH:!kDHEPSK
                                          [ ] TLSv1.3 ciphersuites: TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256
                                          [ ] TLS options: 0x2100000 (+0x0, -0x0)
                                          [ ] Session resumption enabled
                                          [ ] Loading certificate from file: /usr/local/etc/stunnel/stunnel.pem
                                          [ ] Certificate loaded from file: /usr/local/etc/stunnel/stunnel.pem
                                          [ ] Loading private key from file: /usr/local/etc/stunnel/stunnel.pem
                                          [ ] Private key loaded from file: /usr/local/etc/stunnel/stunnel.pem
                                          [ ] Private key check succeeded
                                          [ ] No trusted certificates found
                                          [:] Service [Google Auth Test] needs authentication to prevent MITM attacks
                                          [ ] OCSP: Client OCSP stapling enabled
                                          [ ] DH initialization skipped: client section
                                          [ ] ECDH initialization
                                          [ ] ECDH initialized with curves X25519:P-256:X448:P-521:P-384
                                          [.] Configuration successful
                                          [ ] Deallocating deployed section defaults
                                          [ ] Cleaning up context [stunnel]
                                          [ ] Binding service [Google Auth Test]
                                          [ ] Listening file descriptor created (FD=9)
                                          [ ] Setting accept socket options (FD=9)
                                          [ ] Option SO_REUSEADDR set on accept socket
                                          [.] Binding service [Google Auth Test] to 127.0.0.1:1636: Address already in use (48)
                                          [!] Binding service [Google Auth Test] failed
                                          [ ] Unbinding service [Google Auth Test]
                                          [ ] Service [Google Auth Test] closed
                                          [ ] Deallocating deployed section defaults
                                          [ ] Cleaning up context [stunnel]
                                          [ ] Deallocating section [Google Auth Test]
                                          [ ] Cleaning up context [Google Auth Test]
                                          [ ] Initializing inetd mode configuration
                                          

                                          There you see it fails to start for me because it's already running.

                                          L 1 Reply Last reply Reply Quote 0
                                          • L
                                            leonida368 @stephenw10
                                            last edited by

                                            Hi @stephenw10
                                            I changed the Listen on Port field from 1636 to 1696 but nothing changed. I ran the stunnel command from the shell and the following error came out:
                                            f2c508b8-8e0d-4345-ba66-1d7a1ef5c713-image.png

                                            GertjanG 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.