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

    Problema certificados https con squid + squidguard

    Scheduled Pinned Locked Moved Español
    9 Posts 3 Posters 4.0k 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.
    • C
      chuane
      last edited by

      Buenas tardes.
      He instalado el pfSense y configurado squid + squidguard.

      El proxy funciona bien y filtra por categorías sin problemas. Lo tengo activado en modo transparente.

      El problema que tengo es que cuando intento hacer filtrado también de peticiones https habilitando el 'SSL man in the middle Filtering', los ordenadores clientes que acceden a través del proxy me dan error de certificado.

      He probado a generar un CA y lo he instalado como una autoridad válida de certificados en los navegadores, pero me sigue saliendo el error.

      ¿Qué puedo probar?

      Muchas gracias.

      1 Reply Last reply Reply Quote 0
      • O
        ovni00
        last edited by

        estimado, podrías poner una imagen con lo que sale en pantalla del error

        1 Reply Last reply Reply Quote 0
        • C
          chuane
          last edited by

          Adjunto tres pantallazos que salen en los equipos cliente.

          Sacados desde:
          Firefox en Ubuntu
          Firefox en Windows XP
          Internet Explorer en Windows XP

          El error está en el certificado.

          He instalado el Certificado de CA generado desde pfsense en los equipos cliente.

          Adjunto también pantallazos con la configuración que he puesto.

          Gracias!

          ![Error Firefox Ubuntu.png](/public/imported_attachments/1/Error Firefox Ubuntu.png)
          ![Error Firefox Ubuntu.png_thumb](/public/imported_attachments/1/Error Firefox Ubuntu.png_thumb)
          ![Error Explorer XP.png](/public/imported_attachments/1/Error Explorer XP.png)
          ![Error Explorer XP.png_thumb](/public/imported_attachments/1/Error Explorer XP.png_thumb)
          ![Error Firefox XP.png](/public/imported_attachments/1/Error Firefox XP.png)
          ![Error Firefox XP.png_thumb](/public/imported_attachments/1/Error Firefox XP.png_thumb)
          ![Configuracion 01.png](/public/imported_attachments/1/Configuracion 01.png)
          ![Configuracion 01.png_thumb](/public/imported_attachments/1/Configuracion 01.png_thumb)
          ![Configuracion 02.png](/public/imported_attachments/1/Configuracion 02.png)
          ![Configuracion 02.png_thumb](/public/imported_attachments/1/Configuracion 02.png_thumb)

          1 Reply Last reply Reply Quote 0
          • belleraB
            bellera
            last edited by

            Cuando probé y documenté esto NO seleccioné las opciones:

            Remote Cert checks
            Certificate adapt

            Me suena que algunos usuarios que tenían problemas con los certificados era por haber marcado estas opciones:

            https://forum.pfsense.org/index.php?topic=78337.0

            Aunque en el hilo no lo dice, creo que era esto. O debía ser otro hilo…

            1 Reply Last reply Reply Quote 0
            • C
              chuane
              last edited by

              Buenos días.
              Gracias por la respuesta.

              He probado y revisado el hilo que me indicas, pero sigo con el mismo problema.

              Ahora el error que me sale es otro distinto de certificado y ni siquiera me deja cargar las páginas https.

              Las opciones que me indicas de Remote Cert checks y Certificate adapt no son desmarcables, hay que seleccionar alguno de los valores de la lista.

              En los hilos que he leido marcan las mismas que yo, de todas formas he probado con el resto de opciones y tampoco me va.

              ¿Alguna idea más?

              Muchas gracias.

              ![Error Firefox Ubuntu 02.png](/public/imported_attachments/1/Error Firefox Ubuntu 02.png)
              ![Error Firefox Ubuntu 02.png_thumb](/public/imported_attachments/1/Error Firefox Ubuntu 02.png_thumb)

              1 Reply Last reply Reply Quote 0
              • belleraB
                bellera
                last edited by

                En la versión que tengo de pruebas NO están seleccionadas las opciones. Simplemente NO las toqué de como venían.

                De todas maneras lo que manda es siempre squid.conf

                Copio mi squid.conf de pruebas. No tengo esto en producción por las cuestiones legales que plantea (en Europa) y por la necesidad de instalar certificados en los navegadores.

                Proxy filter SquidGuard: Log page: Proxy config

                # This file is automatically generated by pfSense
                # Do not edit manually !
                
                http_port 192.168.1.1:3128 ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=10MB cert=/usr/pbi/squid-amd64/etc/squid/serverkey.pem capath=/usr/pbi/squid-amd64/share/certs/
                
                http_port 127.0.0.1:3128 intercept ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=10MB cert=/usr/pbi/squid-amd64/etc/squid/serverkey.pem capath=/usr/pbi/squid-amd64/share/certs/
                
                https_port 127.0.0.1:3129 intercept ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=10MB cert=/usr/pbi/squid-amd64/etc/squid/serverkey.pem capath=/usr/pbi/squid-amd64/share/certs/
                
                icp_port 0
                dns_v4_first on
                pid_filename /var/run/squid.pid
                cache_effective_user proxy
                cache_effective_group proxy
                error_default_language ca
                icon_directory /usr/pbi/squid-amd64/etc/squid/icons
                visible_hostname localhost
                cache_mgr admin@localhost
                access_log /var/squid/logs/access.log
                cache_log /var/squid/logs/cache.log
                cache_store_log none
                netdb_filename /var/squid/logs/netdb.state
                pinger_enable off
                pinger_program /usr/pbi/squid-amd64/libexec/squid/pinger
                sslcrtd_program /usr/pbi/squid-amd64/libexec/squid/ssl_crtd -s /var/squid/lib/ssl_db -M 4MB -b 2048
                sslcrtd_children 5
                sslproxy_capath /usr/pbi/squid-amd64/share/certs/
                
                logfile_rotate 10
                debug_options rotate=10
                shutdown_lifetime 3 seconds
                # Allow local network(s) on interface(s)
                acl localnet src  192.168.1.0/24
                uri_whitespace strip
                
                acl dynamic urlpath_regex cgi-bin ?
                cache deny dynamic
                
                cache_mem 8 MB
                maximum_object_size_in_memory 32 KB
                memory_replacement_policy heap GDSF
                cache_replacement_policy heap LFUDA
                cache_dir ufs /var/squid/cache 100 16 256
                minimum_object_size 0 KB
                maximum_object_size 4 KB
                offline_mode off
                cache_swap_low 90
                cache_swap_high 95
                cache allow all
                
                # No redirector configured
                
                #Remote proxies
                
                # Setup some default acls
                # From 3.2 further configuration cleanups have been done to make things easier and safer. The manager, localhost, and to_localhost ACL definitions are now built-in.
                # acl localhost src 127.0.0.1/32
                acl allsrc src all
                acl safeports port 21 70 80 210 280 443 488 563 591 631 777 901  3128 3127 1025-65535 
                acl sslports port 443 563  
                
                # From 3.2 further configuration cleanups have been done to make things easier and safer. The manager, localhost, and to_localhost ACL definitions are now built-in.
                #acl manager proto cache_object
                
                acl purge method PURGE
                acl connect method CONNECT
                
                # Define protocols used for redirects
                acl HTTP proto HTTP
                acl HTTPS proto HTTPS
                http_access allow manager localhost
                
                # Allow external cache managers
                acl ext_manager src 192.168.1.1
                http_access allow manager ext_manager
                
                http_access deny manager
                http_access allow purge localhost
                http_access deny purge
                http_access deny !safeports
                http_access deny CONNECT !sslports
                
                # Always allow localhost connections
                # From 3.2 further configuration cleanups have been done to make things easier and safer. 
                # The manager, localhost, and to_localhost ACL definitions are now built-in.
                # http_access allow localhost
                
                request_body_max_size 0 KB
                delay_pools 1
                delay_class 1 2
                delay_parameters 1 -1/-1 -1/-1
                delay_initial_bucket_level 100
                delay_access 1 allow allsrc
                
                # Reverse Proxy settings
                
                # Package Integration
                url_rewrite_program /usr/pbi/squidguard-squid3-amd64/bin/squidGuard -c /usr/pbi/squidguard-squid3-amd64/etc/squidGuard/squidGuard.conf
                url_rewrite_bypass off
                url_rewrite_children 16 startup=8 idle=4 concurrency=0
                
                # Custom options before auth
                always_direct allow all
                ssl_bump server-first all
                
                # Setup allowed acls
                # Allow local network(s) on interface(s)
                http_access allow localnet
                # Default block all to be sure
                http_access deny allsrc
                
                1 Reply Last reply Reply Quote 0
                • belleraB
                  bellera
                  last edited by

                  Y para más detalles, los procesos son:

                  ps aux | grep -E "proxy|squid"
                  root   89469  0.0  1.0 34312 10664  ??  Is    9:50PM   0:00.00 /usr/pbi/squid-amd64/sbin/squid -f /usr/pbi/squid-amd64/etc/squid/squid.conf
                  proxy  91033  0.0  2.0 50696 20148  ??  S     9:50PM   0:04.02 (squid-1) -f /usr/pbi/squid-amd64/etc/squid/squid.conf (squid)
                  proxy  91292  0.0  0.4 15312  4372  ??  I     9:50PM   0:00.17 (ssl_crtd) -s /var/squid/lib/ssl_db -M 4MB -b 2048 (ssl_crtd)
                  proxy  91521  0.0  0.4 15312  4268  ??  I     9:50PM   0:00.00 (ssl_crtd) -s /var/squid/lib/ssl_db -M 4MB -b 2048 (ssl_crtd)
                  proxy  91819  0.0  0.3 15312  3588  ??  I     9:50PM   0:00.00 (ssl_crtd) -s /var/squid/lib/ssl_db -M 4MB -b 2048 (ssl_crtd)
                  proxy  92287  0.0  0.3 15312  3588  ??  I     9:50PM   0:00.00 (ssl_crtd) -s /var/squid/lib/ssl_db -M 4MB -b 2048 (ssl_crtd)
                  proxy  92384  0.0  0.3 15312  3588  ??  I     9:50PM   0:00.00 (ssl_crtd) -s /var/squid/lib/ssl_db -M 4MB -b 2048 (ssl_crtd)
                  proxy  92395  0.0  1.6 64644 15952  ??  I     9:50PM   0:01.19 (squidGuard) -c /usr/pbi/squidguard-squid3-amd64/etc/squidGuard/squidGuard.conf (squidGuard)
                  proxy  93016  0.0  1.4 64644 14572  ??  I     9:50PM   0:00.05 (squidGuard) -c /usr/pbi/squidguard-squid3-amd64/etc/squidGuard/squidGuard.conf (squidGuard)
                  proxy  93797  0.0  1.4 64644 14572  ??  I     9:50PM   0:00.04 (squidGuard) -c /usr/pbi/squidguard-squid3-amd64/etc/squidGuard/squidGuard.conf (squidGuard)
                  proxy  94282  0.0  1.3 64644 13148  ??  I     9:50PM   0:00.02 (squidGuard) -c /usr/pbi/squidguard-squid3-amd64/etc/squidGuard/squidGuard.conf (squidGuard)
                  proxy  94762  0.0  1.1 64644 10924  ??  I     9:50PM   0:00.02 (squidGuard) -c /usr/pbi/squidguard-squid3-amd64/etc/squidGuard/squidGuard.conf (squidGuard)
                  proxy  94868  0.0  1.1 64644 10924  ??  I     9:50PM   0:00.02 (squidGuard) -c /usr/pbi/squidguard-squid3-amd64/etc/squidGuard/squidGuard.conf (squidGuard)
                  proxy  95143  0.0  1.1 64644 10924  ??  I     9:50PM   0:00.02 (squidGuard) -c /usr/pbi/squidguard-squid3-amd64/etc/squidGuard/squidGuard.conf (squidGuard)
                  proxy  95275  0.0  1.1 64644 10924  ??  I     9:50PM   0:00.02 (squidGuard) -c /usr/pbi/squidguard-squid3-amd64/etc/squidGuard/squidGuard.conf (squidGuard)
                  proxy  95586  0.0  0.2 11252  2056  ??  I     9:50PM   0:00.00 (unlinkd) (unlinkd)
                  
                  1 Reply Last reply Reply Quote 0
                  • C
                    chuane
                    last edited by

                    Buenos días.
                    Edito el fichero /usr/pbi/squid-amd64/etc/squid/squid.conf, pero al reiniciar pfsense me lo vuelve a sobreescribir con los valores que tenía antes

                    ¿Cómo tengo que hacerlo?
                    Gracias

                    1 Reply Last reply Reply Quote 0
                    • belleraB
                      bellera
                      last edited by

                      Por supuesto, eso es lo que hace el configurador web de pfSense.

                      ¿Qué encontraste distinto en tu squid.conf y tienes que modificar?

                      Las opciones que no cubre el configurador web van en:

                      Proxy server: General settings: Custom Options

                      Si eso no fuera suficiente entonces hay que modificar el código del paquete squid para que no grabe de nuevo squid.conf

                      Pero entonces no sirven más los cambos que se hagan en el configurador web.

                      Espero haberme explicado.

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