1 Reply Latest reply on Mar 25, 2020 6:37 PM by ToPe_1312931

    Connectivity Secure TCP Client problem


      I am running this example as well as the Python secure server. The certificates supplied with the example are at the location where I am running the server. The server throws this error.


      $ python tcp_secure_server.py


      TCP Secure Server


      Listening on:

      Traceback (most recent call last):

        File "tcp_secure_server.py", line 104, in <module>

          echo_server(options.hostname, options.port)

        File "tcp_secure_server.py", line 73, in echo_server


        File "/usr/lib/python2.7/ssl.py", line 931, in wrap_socket


        File "/usr/lib/python2.7/ssl.py", line 599, in __init__


        File "/usr/lib/python2.7/ssl.py", line 828, in do_handshake


      ssl.SSLError: [SSL: SSLV3_ALERT_BAD_CERTIFICATE] sslv3 alert bad certificate (_ssl.c:727)


      When the PSoC hits this call in main.c

          while( ( mbedtls_result = mbedtls_ssl_handshake( &ssl ) ) != 0 )


              if( mbedtls_result != MBEDTLS_ERR_SSL_WANT_READ && mbedtls_result != MBEDTLS_ERR_SSL_WANT_WRITE )


                  printf( "Failed! mbedtls_ssl_handshake returned -0x%x\n\n", -mbedtls_result );



        • 1. Re: Connectivity Secure TCP Client problem

          Kitprog3 terminal window shows this.


          CE229252 - ModusToolbox Connectivity Example: Secure TCP Client




          LWiP TCP/IP stack initialized

          WLAN MAC Address : 00:9D:6B:98:D0:74

          WLAN Firmware    : wl0: Sep  5 2019 23:24:33 version (r722362 CY) FWID 01-f7128517

          WLAN CLM         : API: 12.2 Data: 9.10.39 Compiler: 1.29.4 ClmImport: 1.36.3 Creation: 2019-09-05 23:10:00

          WHD VERSION      : v1.60.0 : v1.60.0 : GCC 7.2 : 2019-11-13 21:27:38 -0600

          Wi-Fi driver initialized

          Successfully joined Wi-Fi network 'xyz'

          Wi-Fi interface added to TCP/IP stack

          IP Address assigned

          Success: The random number generator has been seeded

          Connecting to TCP Server /

          Successfully connected to TCP Server /

          Setting up the SSL/TLS Layer...

          Performing the SSL/TLS handshake...Failed! mbedtls_ssl_handshake returned -0x2700



          Failed! mbedtls_ssl_handshake returned -0x50



          Failed! mbedtls_ssl_handshake returned -0x4e