Skip to content

Commit

Permalink
Explicitly skip tls_option=none for grants
Browse files Browse the repository at this point in the history
That removes SSL requirements from the user, so let's be careful about
that.
As none is the default, we'll skip it here.
  • Loading branch information
petoju committed Sep 5, 2022
1 parent 44b9435 commit 3009a76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mysql/resource_grant.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func CreateGrant(d *schema.ResourceData, meta interface{}) error {
userOrRole)

// MySQL 8+ doesn't allow REQUIRE on a GRANT statement.
if !hasRoles && d.Get("tls_option").(string) != "" {
if !hasRoles && d.Get("tls_option").(string) != "" && strings.ToLower(d.Get("tls_option").(string)) != "none" {
stmtSQL += fmt.Sprintf(" REQUIRE %s", d.Get("tls_option").(string))
}

Expand Down

0 comments on commit 3009a76

Please sign in to comment.