Uploaded image for project: 'MariaDB Connector/node.js'
  1. MariaDB Connector/node.js
  2. CONJS-323

regression: "TypeError: validationFunction is not a function"

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 3.4.3, 3.4.4
    • 3.4.5
    • security
    • None

    Description

      SSL Connection Error with MariaDB Node.js Connector 3.4.3/3.4.4

      Reference: https://github.com/mariadb-corporation/mariadb-connector-nodejs/issues/319

      Problem:

      When using MariaDB Node.js connector versions 3.4.3 or 3.4.4 with SSL enabled and a custom CA certificate, without specific checkServerIdentity, connections to MariaDB servers prior to version 11.4 or MySQL servers will fail with the following error:

      TypeError: validationFunction is not a function
          at Authentication.handshakeResult (....../node_modules/mariadb/lib/cmd/handshake/authentication.js:105:35)
          at Authentication.onPacketReceive (....../node_modules/mariadb/lib/cmd/handshake/authentication.js:42:17)
          at PacketInputStream.receivePacketBasic (....../node_modules/mariadb/lib/io/packet-input-stream.js:85:9)
          at PacketInputStream.onData (....../node_modules/mariadb/lib/io/packet-input-stream.js:135:20)
          at TLSSocket.emit (node:events:520:28)
          at addChunk (node:internal/streams/readable:559:12)
          at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
          at Readable.push (node:internal/streams/readable:390:5)
          at TLSWrap.onStreamRead (node:internal/stream_base_commons:191:23)
      

      Workaround

      Add `checkServerIdentity: null` to your SSL configuration to bypass issue.

      Before (causes error):

      const dbConf = {
         host: 'localhost',
          user: 'myUser',
          password: 'myPwd',
         ssl: {
           ca: caFile
         }
      }
      

      must be :

      const dbConf = {
         host: 'localhost',
          user: 'myUser',
          password: 'myPwd',
         ssl: {
           ca: caFile,
           checkServerIdentity: null
         }
      }
      

      (checkServerIdentity will still be executed)

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            diego dupin Diego Dupin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.