sipcapture / captagent

100% Open-Source Packet Capture Agent for HEP
https://sipcapture.org
GNU Affero General Public License v3.0
167 stars 75 forks source link

TLS doesn't work for captagent #250

Closed perrfect closed 2 years ago

perrfect commented 2 years ago

Hello. I've configured captagent according to the documentation.

captagent 6.3.1

Build directory............. :
Installation prefix......... : /usr/local/captagent
HEP Compression............. : no
IPv6 support.................: no
HEP SSL/TLS................. : yes
Flex........................ : flex
Bison....................... : bison -y

Build with REDIS............ : no
Build with MySQL............ : no
Build with PCRE............. : no
Build with LibUV............ : yes
Build with EPAN............. : no
Build with TLS.............. : yes

I'm using Rocky Linux release 8.6 and next packages are installed:

flex-devel-2.6.1-9.el8.x86_64
libuv-devel-1.41.1-1.el8_4.x86_64
automake-1.16.1-7.el8.noarch
expat-devel-2.2.5-8.el8_6.2.x86_64
libtool-ltdl-2.4.6-25.el8.x86_64
libpcap-devel-1.9.1-5.el8.x86_64
libuv-1.41.1-1.el8_4.x86_64
libtool-2.4.6-25.el8.x86_64
flex-2.6.1-9.el8.x86_64
libgcrypt-1.8.5-7.el8_6.x86_64
bison-3.0.4-10.el8.x86_64

My captagent configs looks like: captagent.xml


<?xml version="1.0"?>
<document type="captagent/xml">
        <configuration name="core.conf" description="CORE Settings" serial="2014024212">
            <settings>
                <param name="debug" value="3"/>
                <param name="version" value="2"/>
                <param name="serial" value="2022051702"/>
                <param name="uuid" value="00781a4a-5b69-11e4-9522-bb79a8fcf0f3"/>
                <param name="daemon" value="true"/>
                <param name="syslog" value="true"/>
                <param name="pid_file" value="/var/run/captagent.pid"/>
                <!-- Configure using installation path if different from default -->
                <param name="module_path" value="/usr/local/captagent/lib/captagent/modules"/>
                <param name="config_path" value="/usr/local/captagent/etc/captagent/"/>
                <param name="capture_plans_path" value="/usr/local/captagent/etc/captagent/captureplans"/>
                <param name="backup" value="/usr/local/captagent/etc/captagent/backup"/>
                <param name="chroot" value="/usr/local/captagent/etc/captagent"/>
            </settings>
        </configuration>
        <configuration name="modules.conf" description="Modules">
            <modules>

                <load module="transport_hep" register="local"/>
                <load module="protocol_sip" register="local"/>
                <load module="database_hash" register="local"/>
                <load module="protocol_rtcp" register="local"/>
                <load module="protocol_tls" register="local"/>
                <load module="socket_pcap" register="local"/>
                <load module="socket_tzsp" register="local"/>
                <load module="protocol_ss7" register="local"/>
                <load module="protocol_diameter" register="local"/>
                <load module="output_json" register="local"/>
                <load module="protocol_rtcp" register="local"/>
                <load module="interface_http" register="local"/>
                <load module="database_redis" register="local"/>
                <load module="socket_pfring" register="local"/>
                -->
        </modules>
        </configuration>
</document>

protocol_tls.xml

<?xml version="1.0"?>
<document type="captagent_module/xml">
  <module name="protocol_tls" description="TLS Protocol" serial="2014010402">
    <profile name="proto_tls" description="TLS PROTO" enable="true" serial="2014010402">
      <settings>
        <param name="flow-timeout" value="180"/>
        <param name="private-key-path" value="/usr/local/captagent/certs/sip.key"/>
      </settings>
    </profile>
  </module>
</document>

But on logs I'm getting the error all the time: [ERR] protocol_tls.c:269 TLS has been not enabled. Please reconfigure captagent with param --enable-ssl and --enable-tls

Could please help me solve it?

kYroL01 commented 2 years ago

Hi @perrfect First of all I remember that the TLS module work only with old ciphers key (unsecure) as written here Anyway could be that you forgot to enable the module in socket_pcap.xml