MySQL – Connectivity – Error – “Public Key Retrieval is not allowed”

Background

Trying to connect to a MySQL instance, but ran into an error.

Error

Error Text

Public Key Retrieval is not allowed

Error Image

publicKeyRetrievalIsNotAllowed.error.01.20200803.1057PM

Remediation

Outline

  1. General
    • Set Attribute
      • Set attribute AllowPublicKeyRetrieval to true
  2. DBeaver
    • Window – Connect to Database
      • Connection Settings
        • Tab – “Driver Properties”
          • Toggle Property “AllowPublicKeyRetrieval
            • Change from false to true

Images

Image – Connection Settings – Driver Properties

Image – Connection Settings – Driver Properties – Before

configuration.tab.DriverProperties.02.20200803.1103PM

Image – Connection Settings – Driver Properties – After

configuration.tab.DriverProperties.04.20200803.1105PM.PNG

Summary

MySQL v8 hardens the platform.

During installation one can configure the server to pass along its name via an SSL Certificate.

The client will thus review the passed along certificate and ensure the server being communicated is the server it intends to communicate with.

Ensuring the server name lessens the possibility of “man in the middle” attacks/susceptibility.

Additional Reading

Please read more on MySQL’s caching_sha2_password authentication plugin.

References

  1. MySQL Connnector
    • Net 8.0 API Reference
      • MySqlConnectionStringBuilder
        • MySqlConnectionStringBuilder.AllowPublicKeyRetrieval Property
          Link
  2. MySQL
    • MySQL
      • Security
        • Security Components and Plugins
          • Caching SHA-2 Pluggable Authentication
            Link

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s