Ad Widget

Collapse

Windows Agent compiled without TLS support

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mrogers-9898
    Member
    • Sep 2008
    • 68

    #1

    Windows Agent compiled without TLS support

    Hey All,

    The Zabbix agent for Windows has not been compiled to support encryption.

    When starting with any encryption related parameters it spits out

    HTML Code:
    zabbix_agentd.exe [17072]: "TLSConnect" configuration parameter cannot be used: Zabbix agent was compiled without TLS support
    zabbix_agentd.exe [17072]: "TLSAccept" configuration parameter cannot be used: Zabbix agent was compiled without TLS support
    zabbix_agentd.exe [17072]: "TLSPSKIdentity" configuration parameter cannot be used: Zabbix agent was compiled without TLS support
    zabbix_agentd.exe [17072]: "TLSPSKFile" configuration parameter cannot be used: Zabbix agent was compiled without TLS support
    There is a ticket about it - https://support.zabbix.com/browse/ZBXNEXT-3047 - should anyone want to vote to assist getting it actioned.

    Has anyone compiled the Windows agent versions themselves with TLS support?
  • mrogers-9898
    Member
    • Sep 2008
    • 68

    #2
    I've been able to figure out how to compile the agent on Windows.

    But I've not been able to figure out how to alter the configuration so it compiles with TLS support.

    The src comes with makefiles for the Windows agent, but I cannot for the life of me figure out how to change them for TLS.

    I can see in the (bash?) configure script, these values are added if we option for SSL and it passes verification;

    OPENSSL_CFLAGS=-I/usr/include
    OPENSSL_LDFLAGS=-L/usr/lib
    OPENSSL_LIBS="-lssl -lcrypto"
    found_openssl="yes"

    Obviously those paths are not Windows paths.

    Comment

    • mrogers-9898
      Member
      • Sep 2008
      • 68

      #3
      I've made some slow progress. Perhaps someone with some Windows C++ dev work can shed the light on where to go next.

      I got the makefile to enable openssl through adding a few values at the top, which they persumably populate through proper switches, which I can't find documentation for.

      Makefile_tls.inc
      TLS = openssl
      TLSLIBDIR = E:\openssl
      TLSINCDIR = E:\openssl-1.0.2f
      So it attempts to compile, however I get compiler errors.
      E:\zabbix-3.0.1\build\win32\project>nmake /f Makefile_agent

      Microsoft (R) Program Maintenance Utility Version 12.00.21005.1
      Copyright (C) Microsoft Corporation. All rights reserved.

      cl.exe ..\..\..\src\libs\zbxcrypto\tls.c /Fo"..\..\..\src\libs\zbxcrypto\tls.o" /I ..\..\..\src\zabbix_agent /I .\ /I ..\include /I ..\..\..\include /I "E:\openssl-1.0.2f" /D WITH_AGENT_METRICS /D WITH_COMMON_METRICS /D WITH_SPECIFIC_METRICS /D WITH_HOSTNAME_METRIC /D WITH_SIMPLE_METRICS /Zi /Fdzabbix_agentd.exe.pdb /nologo /O2 /Ob1 /GF /FD /EHsc /MT /Gy /W3 /c /D _WINDOWS /D _WIN32_WINNT=0x0500 /D _CONSOLE /D UNICODE /D _UNICODE /D HAVE_WINLDAP_H /D HAVE_ASSERT_H /D ZABBIX_SERVICE /D "_VC80_UPGRADE=0x0600" /D HAVE_IPV6 /TC /DHAVE_OPENSSL
      tls.c
      C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\stdint.h(14) : error C2632: 'int' followed by 'int' is illegal
      C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\stdint.h(14) : warning C4091: 'typedef ' : ignored on left of 'unsigned int' when no variable is declared
      E:\zabbix-3.0.1\src\zabbix_agent\openssl/lhash.h(270) : warning C4090: 'function' : different 'const' qualifiers
      ..\..\..\src\libs\zbxcrypto\tls.c(1593) : error C2037: left of 'cipher_list' specifies undefined struct/union 'ssl_ctx_st'
      ..\..\..\src\libs\zbxcrypto\tls.c(1593) : error C2198: 'sk_SSL_CIPHER_num' : too few arguments for call
      ..\..\..\src\libs\zbxcrypto\tls.c(1598) : error C2037: left of 'cipher_list' specifies undefined struct/union 'ssl_ctx_st'
      ..\..\..\src\libs\zbxcrypto\tls.c(1598) : warning C4047: 'function' : 'const stack_st_SSL_CIPHER *' differs in levels of indirection from 'int'
      ..\..\..\src\libs\zbxcrypto\tls.c(1598) : warning C4024: 'sk_SSL_CIPHER_value' : different types for formal and actual parameter 1
      ..\..\..\src\libs\zbxcrypto\tls.c(1598) : error C2198: 'sk_SSL_CIPHER_value' : too few arguments for call
      ..\..\..\src\libs\zbxcrypto\tls.c(1598) : error C2037: left of 'name' specifies undefined struct/union 'ssl_cipher_st'
      ..\..\..\src\libs\zbxcrypto\tls.c(4160) : warning C4244: 'function' : conversion from 'ZBX_SOCKET' to 'int', possible loss of data
      ..\..\..\src\libs\zbxcrypto\tls.c(4960) : warning C4244: 'function' : conversion from 'ZBX_SOCKET' to 'int', possible loss of data
      ..\..\..\src\libs\zbxcrypto\tls.c(5377) : error C2037: left of 'psk_identity' specifies undefined struct/union 'ssl_session_st'
      NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\amd64\cl.exe"' : return code '0x2'
      Stop.

      Comment

      • dedisoft
        Junior Member
        • Dec 2013
        • 18

        #4
        Hi,

        I've successfully compiled the agent version 3.0.1 for Win64 platform.

        OpenSSL 1.0.2.7 is used.

        Microsoft Visual C++ Redistributable is required (https://www.microsoft.com/fr-FR/down....aspx?id=48145).

        You can download it here : http://dl.free.fr/mEJSaErXp

        Regards,

        Comment

        • mrogers-9898
          Member
          • Sep 2008
          • 68

          #5
          oh that's great!

          Would it be possible for you to outline at all your process?

          Comment

          • dedisoft
            Junior Member
            • Dec 2013
            • 18

            #6
            - You must have Perl and a C compiler (I use Visual Studio 2015)
            - Download OpenSSL and Zabbix Source
            - Compile OpenSSL (see Readme)
            -Modify the file zabbix/src/libs/zbxsysinfo/common/system.c like this :

            (at line 68), replace :

            /* timezone offset */
            #if defined(HAVE_TM_TM_GMTOFF)
            gmtoff = tm->tm_gmtoff;
            #else
            gmtoff = -timezone;
            #endif

            By :

            /* timezone offset */
            #if defined(HAVE_TM_TM_GMTOFF)
            gmtoff = tm->tm_gmtoff;
            #else
            #ifdef _WINDOWS
            gmtoff = -_timezone;
            #else
            gmtoff = -timezone;
            #endif
            #endif

            Set CPU, TLS, TLSLIBDIR, TLSINCDIR variable and compile Zabbix.

            That's done.

            Regards,

            Comment

            • zoc
              Junior Member
              • Oct 2015
              • 6

              #7
              compile error

              Hi, I am compiling my version of windows zabbix agent with TSL support and I am stuck with this error....

              C:\zabbix-3.0.1\build\win32\project>nmake CPU=AMD64 TLS=openssl TLSINCDIR="C:\Op
              enSSL-Win32" TLSLIB="C:\OpenSSL-Win32\lib\libeay32.lib" TLSLIB2="C:\OpenSSL-Win3
              2\lib\ssleay32.lib"

              C:\zabbix-3.0.1\build\win32\project>
              C:\zabbix-3.0.1\build\win32\project>nmake

              Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
              Copyright (C) Microsoft Corporation. All rights reserved.

              nmake /f Makefile_agent

              Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
              Copyright (C) Microsoft Corporation. All rights reserved.

              cl.exe ..\..\..\src\libs\zbxconf\cfg.c /Fo"..\..\..\src\libs\zbxconf\cfg
              .o" /I ..\..\..\src\zabbix_agent /I .\ /I ..\include /I ..\..\..\include /D WIT
              H_AGENT_METRICS /D WITH_COMMON_METRICS /D WITH_SPECIFIC_METRICS /D WITH_HOSTNAM
              E_METRIC /D WITH_SIMPLE_METRICS /Zi /Fdzabbix_agentd.exe.pdb /nologo /O2 /Ob1 /G
              F /FD /EHsc /MT /Gy /W3 /c /D _WINDOWS /D _WIN32_WINNT=0x0500 /D _CONSOLE /D UN
              ICODE /D _UNICODE /D HAVE_WINLDAP_H /D HAVE_ASSERT_H /D ZABBIX_SERVICE /D "_VC8
              0_UPGRADE=0x0600" /D HAVE_IPV6 /TC
              cfg.c
              ..\..\..\src\libs\zbxconf\cfg.c(246) : error C2065: 'ZBX_CFG_FILE_REQUIRED' : un
              declared identifier
              ..\..\..\src\libs\zbxconf\cfg.c(337) : error C2065: 'ZBX_CFG_FILE_REQUIRED' : un
              declared identifier
              ..\..\..\src\libs\zbxconf\cfg.c(446) : error C2036: 'cfg_line *' : unknown size
              ..\..\..\src\libs\zbxconf\cfg.c(446) : error C2037: left of 'parameter' specifie
              s undefined struct/union 'cfg_line'
              ..\..\..\src\libs\zbxconf\cfg.c(448) : error C2036: 'cfg_line *' : unknown size
              ..\..\..\src\libs\zbxconf\cfg.c(448) : error C2037: left of 'parameter' specifie
              s undefined struct/union 'cfg_line'
              ..\..\..\src\libs\zbxconf\cfg.c(448) : error C2168: 'strcmp' : too few actual pa
              rameters for intrinsic function
              ..\..\..\src\libs\zbxconf\cfg.c(456) : error C2036: 'cfg_line *' : unknown size
              ..\..\..\src\libs\zbxconf\cfg.c(456) : error C2037: left of 'type' specifies und
              efined struct/union 'cfg_line'
              ..\..\..\src\libs\zbxconf\cfg.c(458) : error C2065: 'TYPE_INT' : undeclared iden
              tifier
              ..\..\..\src\libs\zbxconf\cfg.c(458) : error C2051: case expression not constant

              ..\..\..\src\libs\zbxconf\cfg.c(462) : error C2036: 'cfg_line *' : unknown size
              ..\..\..\src\libs\zbxconf\cfg.c(462) : error C2037: left of 'min' specifies unde
              fined struct/union 'cfg_line'
              ..\..\..\src\libs\zbxconf\cfg.c(462) : error C2036: 'cfg_line *' : unknown size
              ..\..\..\src\libs\zbxconf\cfg.c(462) : error C2037: left of 'max' specifies unde
              fined struct/union 'cfg_line'
              ..\..\..\src\libs\zbxconf\cfg.c(462) : error C2036: 'cfg_line *' : unknown size
              ..\..\..\src\libs\zbxconf\cfg.c(462) : error C2037: left of 'max' specifies unde
              fined struct/union 'cfg_line'
              ..\..\..\src\libs\zbxconf\cfg.c(465) : error C2036: 'cfg_line *' : unknown size
              ..\..\..\src\libs\zbxconf\cfg.c(465) : error C2037: left of 'variable' specifies
              undefined struct/union 'cfg_line'
              ..\..\..\src\libs\zbxconf\cfg.c(467) : error C2065: 'TYPE_STRING_LIST' : undecla
              red identifier
              ..\..\..\src\libs\zbxconf\cfg.c(467) : error C2051: case expression not constant

              ..\..\..\src\libs\zbxconf\cfg.c(470) : error C2065: 'TYPE_STRING' : undeclared i
              dentifier
              ..\..\..\src\libs\zbxconf\cfg.c(470) : error C2051: case expression not constant

              ..\..\..\src\libs\zbxconf\cfg.c(471) : error C2036: 'cfg_line *' : unknown size
              ..\..\..\src\libs\zbxconf\cfg.c(471) : error C2037: left of 'variable' specifies
              undefined struct/union 'cfg_line'
              ..\..\..\src\libs\zbxconf\cfg.c(472) : error C2036: 'cfg_line *' : unknown size
              ..\..\..\src\libs\zbxconf\cfg.c(472) : error C2037: left of 'variable' specifies
              undefined struct/union 'cfg_line'
              ..\..\..\src\libs\zbxconf\cfg.c(472) : error C2198: 'zbx_strdup2' : too few argu
              ments for call
              ..\..\..\src\libs\zbxconf\cfg.c(474) : error C2065: 'TYPE_MULTISTRING' : undecla
              red identifier
              ..\..\..\src\libs\zbxconf\cfg.c(474) : error C2051: case expression not constant

              ..\..\..\src\libs\zbxconf\cfg.c(475) : error C2036: 'cfg_line *' : unknown size
              ..\..\..\src\libs\zbxconf\cfg.c(475) : error C2037: left of 'variable' specifies
              undefined struct/union 'cfg_line'
              ..\..\..\src\libs\zbxconf\cfg.c(475) : warning C4047: 'function' : 'char ***' di
              ffers in levels of indirection from 'char *'
              ..\..\..\src\libs\zbxconf\cfg.c(475) : warning C4024: 'zbx_strarr_add' : differe
              nt types for formal and actual parameter 1
              ..\..\..\src\libs\zbxconf\cfg.c(475) : error C2198: 'zbx_strarr_add' : too few a
              rguments for call
              ..\..\..\src\libs\zbxconf\cfg.c(477) : error C2065: 'TYPE_UINT64' : undeclared i
              dentifier
              ..\..\..\src\libs\zbxconf\cfg.c(477) : error C2051: case expression not constant

              ..\..\..\src\libs\zbxconf\cfg.c(481) : error C2036: 'cfg_line *' : unknown size
              ..\..\..\src\libs\zbxconf\cfg.c(481) : error C2037: left of 'min' specifies unde
              fined struct/union 'cfg_line'
              ..\..\..\src\libs\zbxconf\cfg.c(481) : error C2036: 'cfg_line *' : unknown size
              ..\..\..\src\libs\zbxconf\cfg.c(481) : error C2037: left of 'max' specifies unde
              fined struct/union 'cfg_line'
              ..\..\..\src\libs\zbxconf\cfg.c(481) : error C2036: 'cfg_line *' : unknown size
              ..\..\..\src\libs\zbxconf\cfg.c(481) : error C2037: left of 'max' specifies unde
              fined struct/union 'cfg_line'
              ..\..\..\src\libs\zbxconf\cfg.c(484) : error C2036: 'cfg_line *' : unknown size
              ..\..\..\src\libs\zbxconf\cfg.c(484) : error C2037: left of 'variable' specifies
              undefined struct/union 'cfg_line'
              ..\..\..\src\libs\zbxconf\cfg.c(491) : error C2065: 'ZBX_CFG_STRICT' : undeclare
              d identifier
              ..\..\..\src\libs\zbxconf\cfg.c(500) : error C2036: 'cfg_line *' : unknown size
              ..\..\..\src\libs\zbxconf\cfg.c(500) : error C2037: left of 'parameter' specifie
              s undefined struct/union 'cfg_line'
              ..\..\..\src\libs\zbxconf\cfg.c(502) : error C2065: 'PARM_MAND' : undeclared ide
              ntifier
              ..\..\..\src\libs\zbxconf\cfg.c(502) : error C2036: 'cfg_line *' : unknown size
              ..\..\..\src\libs\zbxconf\cfg.c(502) : error C2037: left of 'mandatory' specifie
              s undefined struct/union 'cfg_line'
              ..\..\..\src\libs\zbxconf\cfg.c(505) : error C2036: 'cfg_line *' : unknown size
              ..\..\..\src\libs\zbxconf\cfg.c(505) : error C2037: left of 'type' specifies und
              efined struct/union 'cfg_line'
              ..\..\..\src\libs\zbxconf\cfg.c(507) : error C2065: 'TYPE_INT' : undeclared iden
              tifier
              ..\..\..\src\libs\zbxconf\cfg.c(507) : error C2051: case expression not constant

              ..\..\..\src\libs\zbxconf\cfg.c(508) : error C2036: 'cfg_line *' : unknown size
              ..\..\..\src\libs\zbxconf\cfg.c(508) : error C2037: left of 'variable' specifies
              undefined struct/union 'cfg_line'
              ..\..\..\src\libs\zbxconf\cfg.c(511) : error C2065: 'TYPE_STRING' : undeclared i
              dentifier
              ..\..\..\src\libs\zbxconf\cfg.c(511) : error C2051: case expression not constant

              ..\..\..\src\libs\zbxconf\cfg.c(512) : error C2065: 'TYPE_STRING_LIST' : undecla
              red identifier
              ..\..\..\src\libs\zbxconf\cfg.c(512) : error C2051: case expression not constant

              ..\..\..\src\libs\zbxconf\cfg.c(513) : error C2036: 'cfg_line *' : unknown size
              ..\..\..\src\libs\zbxconf\cfg.c(513) : error C2037: left of 'variable' specifies
              undefined struct/union 'cfg_line'
              ..\..\..\src\libs\zbxconf\cfg.c(542) : error C2036: 'cfg_line *' : unknown size
              ..\..\..\src\libs\zbxconf\cfg.c(542) : error C2037: left of 'parameter' specifie
              s undefined struct/union 'cfg_line'
              ..\..\..\src\libs\zbxconf\cfg.c(549) : error C2036: 'cfg_line *' : unknown size
              ..\..\..\src\libs\zbxconf\cfg.c(549) : error C2037: left of 'parameter' specifie
              s undefined struct/union 'cfg_line'
              NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\
              VC\Bin\amd64\cl.exe"' : return code '0x2'
              Stop.
              NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\
              VC\Bin\amd64\nmake.EXE"' : return code '0x2'
              Stop.

              Can anyone please help me to resolve this error?

              BR

              Comment

              • kamilalek1
                Junior Member
                • Jul 2016
                • 16

                #8
                Zabbix Agent 3.0.4 openssl 1.0.2h Win64

                I need Zabbix Agent 3.0.4 openssl 1.0.2h Win64
                Where can I download it?
                I tried to compile it, but without success.
                Alternatively, I would ask for instructions to compile
                Zabbix Agent 3.0.4 openssl 1.0.2h Win64

                Comment

                Working...