diff --git a/.changelog/17481.txt b/.changelog/17481.txt
new file mode 100644
index 0000000000000..89ad16998e836
--- /dev/null
+++ b/.changelog/17481.txt
@@ -0,0 +1,3 @@
+```release-note:bug
+tlsutil: Default setting of ServerName field in outgoing TLS configuration for checks now handled by crypto/tls.
+```
diff --git a/.changelog/17846.txt b/.changelog/17846.txt
new file mode 100644
index 0000000000000..bd5a052f851f7
--- /dev/null
+++ b/.changelog/17846.txt
@@ -0,0 +1,3 @@
+```release-note:bug
+connect/ca: Fixes a bug preventing CA configuration updates in secondary datacenters
+```
diff --git a/.github/workflows/verify-release-linux.yaml b/.github/workflows/verify-release-linux.yaml
deleted file mode 100644
index a86da7f05fb3e..0000000000000
--- a/.github/workflows/verify-release-linux.yaml
+++ /dev/null
@@ -1,78 +0,0 @@
-# Copyright (c) HashiCorp, Inc.
-# SPDX-License-Identifier: MPL-2.0
-
-name: Verify Release - Linux
-
-on:
- workflow_dispatch:
- inputs:
- packageName:
- description: 'Name of consul release package (consul vs consul-enterprise)'
- required: true
- default: 'consul'
- type: choice
- options:
- - consul
- - consul-enterprise
- version:
- description: The x.y.z version (also need to specify applicable suffixes like +ent and -dev)'
- required: true
- type: string
-
-jobs:
- verify-ubuntu-amd64:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- - name: docker build with version
- run: |
- docker build \
- --build-arg PACKAGE=${{ inputs.packageName }} \
- --build-arg VERSION=${{ inputs.version }} \
- --build-arg TARGETARCH=amd64 \
- -f ./build-support/docker/Verify-Release-Ubuntu.dockerfile .
-
- verify-debian-amd64:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- - name: docker build with version
- run: |
- docker build \
- --build-arg PACKAGE=${{ inputs.packageName }} \
- --build-arg VERSION=${{ inputs.version }} \
- --build-arg TARGETARCH=amd64 \
- -f ./build-support/docker/Verify-Release-Debian.dockerfile .
-
- verify-fedora:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- - name: docker build with version
- run: |
- docker build \
- --build-arg PACKAGE=${{ inputs.packageName }} \
- --build-arg VERSION=${{ inputs.version }} \
- -f ./build-support/docker/Verify-Release-Fedora.dockerfile .
-
- verify-centos:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- - name: docker build with version
- run: |
- docker build \
- --build-arg PACKAGE=${{ inputs.packageName }} \
- --build-arg VERSION=${{ inputs.version }} \
- -f ./build-support/docker/Verify-Release-CentOS.dockerfile .
-
- verify-amazon:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- - name: docker build with version
- run: |
- docker build \
- --build-arg PACKAGE=${{ inputs.packageName }} \
- --build-arg VERSION=${{ inputs.version }} \
- -f ./build-support/docker/Verify-Release-Amazon.dockerfile .
diff --git a/agent/consul/leader_connect_ca.go b/agent/consul/leader_connect_ca.go
index 8c715588eece3..c8c63c8874aad 100644
--- a/agent/consul/leader_connect_ca.go
+++ b/agent/consul/leader_connect_ca.go
@@ -735,7 +735,9 @@ func shouldPersistNewRootAndConfig(newActiveRoot *structs.CARoot, oldConfig, new
if newConfig == nil {
return false
}
- return newConfig.Provider == oldConfig.Provider && reflect.DeepEqual(newConfig.Config, oldConfig.Config)
+
+ // Do not persist if the new provider and config are the same as the old
+ return !(newConfig.Provider == oldConfig.Provider && reflect.DeepEqual(newConfig.Config, oldConfig.Config))
}
func (c *CAManager) UpdateConfiguration(args *structs.CARequest) (reterr error) {
diff --git a/build-support/docker/Verify-Release-Amazon.dockerfile b/build-support/docker/Verify-Release-Amazon.dockerfile
deleted file mode 100644
index 591b234c3b7cc..0000000000000
--- a/build-support/docker/Verify-Release-Amazon.dockerfile
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright (c) HashiCorp, Inc.
-# SPDX-License-Identifier: MPL-2.0
-
-FROM amazonlinux:latest
-RUN yum install -y yum-utils shadow-utils
-RUN yum-config-manager --add-repo https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo
-ARG PACKAGE=consul \
-ARG VERSION \
-ARG SUFFIX=1
-RUN yum install -y ${PACKAGE}-${VERSION}-${SUFFIX}
diff --git a/build-support/docker/Verify-Release-CentOS.dockerfile b/build-support/docker/Verify-Release-CentOS.dockerfile
deleted file mode 100644
index a2be67ac776f7..0000000000000
--- a/build-support/docker/Verify-Release-CentOS.dockerfile
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright (c) HashiCorp, Inc.
-# SPDX-License-Identifier: MPL-2.0
-
-FROM centos:7
-RUN yum install -y yum-utils
-RUN yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
-ARG PACKAGE=consul \
-ARG VERSION \
-ARG SUFFIX=1
-RUN yum install -y ${PACKAGE}-${VERSION}-${SUFFIX}
\ No newline at end of file
diff --git a/build-support/docker/Verify-Release-Debian.dockerfile b/build-support/docker/Verify-Release-Debian.dockerfile
deleted file mode 100644
index 533890bca43f8..0000000000000
--- a/build-support/docker/Verify-Release-Debian.dockerfile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright (c) HashiCorp, Inc.
-# SPDX-License-Identifier: MPL-2.0
-
-FROM debian:bullseye
-RUN apt update && apt install -y software-properties-common curl gnupg
-RUN curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add -
-ARG TARGETARCH=amd64
-RUN apt-add-repository "deb [arch=${TARGETARCH}] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
-ARG PACKAGE=consul \
-ARG VERSION \
-ARG SUFFIX=1
-RUN apt-get update && apt-get install -y ${PACKAGE}=${VERSION}-${SUFFIX}
\ No newline at end of file
diff --git a/build-support/docker/Verify-Release-Fedora.dockerfile b/build-support/docker/Verify-Release-Fedora.dockerfile
deleted file mode 100644
index 601751a911825..0000000000000
--- a/build-support/docker/Verify-Release-Fedora.dockerfile
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright (c) HashiCorp, Inc.
-# SPDX-License-Identifier: MPL-2.0
-
-FROM fedora:latest
-RUN dnf install -y dnf-plugins-core
-RUN dnf config-manager --add-repo https://rpm.releases.hashicorp.com/fedora/hashicorp.repo
-ARG PACKAGE=consul \
-ARG VERSION \
-ARG SUFFIX=1
-RUN dnf install -y ${PACKAGE}-${VERSION}-${SUFFIX}
diff --git a/build-support/docker/Verify-Release-Ubunt-i386.dockerfile b/build-support/docker/Verify-Release-Ubunt-i386.dockerfile
deleted file mode 100644
index 82913b4f7261a..0000000000000
--- a/build-support/docker/Verify-Release-Ubunt-i386.dockerfile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright (c) HashiCorp, Inc.
-# SPDX-License-Identifier: MPL-2.0
-
-FROM i386/ubuntu:latest
-RUN apt update && apt install -y software-properties-common curl
-RUN curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add -
-ARG TARGETARCH=amd64
-RUN apt-add-repository "deb [arch=${TARGETARCH}] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
-ARG PACKAGE=consul \
-ARG VERSION \
-ARG SUFFIX=1
-RUN apt-get update && apt-get install -y ${PACKAGE}=${VERSION}-${SUFFIX}
diff --git a/build-support/docker/Verify-Release-Ubuntu.dockerfile b/build-support/docker/Verify-Release-Ubuntu.dockerfile
deleted file mode 100644
index ddeffc40c5f64..0000000000000
--- a/build-support/docker/Verify-Release-Ubuntu.dockerfile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright (c) HashiCorp, Inc.
-# SPDX-License-Identifier: MPL-2.0
-
-FROM ubuntu:latest
-RUN apt update && apt install -y software-properties-common curl
-RUN curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add -
-ARG TARGETARCH=amd64
-RUN apt-add-repository "deb [arch=${TARGETARCH}] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
-ARG PACKAGE=consul \
-ARG VERSION \
-ARG SUFFIX=1
-RUN apt-get update && apt-get install -y ${PACKAGE}=${VERSION}-${SUFFIX}
diff --git a/tlsutil/config.go b/tlsutil/config.go
index 5cdaf7633eca5..a52d6b6ad829b 100644
--- a/tlsutil/config.go
+++ b/tlsutil/config.go
@@ -857,10 +857,23 @@ func (c *Configurator) IncomingHTTPSConfig() *tls.Config {
return config
}
-// OutgoingTLSConfigForCheck generates a *tls.Config for outgoing TLS connections
-// for checks. This function is separated because there is an extra flag to
-// consider for checks. EnableAgentTLSForChecks and InsecureSkipVerify has to
-// be checked for checks.
+// OutgoingTLSConfigForCheck creates a client *tls.Config for executing checks.
+// It is RECOMMENDED that the serverName be left unspecified. The crypto/tls
+// client will deduce the ServerName (for SNI) from the check address unless
+// it's an IP (RFC 6066, Section 3). However, there are two instances where
+// supplying a serverName is useful:
+//
+// 1. When the check address is an IP, a serverName can be supplied for SNI.
+// Note: setting serverName will also override the hostname used to verify
+// the certificate presented by the server being checked.
+//
+// 2. When the hostname in the check address won't be present in the SAN
+// (Subject Alternative Name) field of the certificate presented by the
+// server being checked. Note: setting serverName will also override the
+// ServerName used for SNI.
+//
+// Setting skipVerify will disable verification of the server's certificate
+// chain and hostname, which is generally not suitable for production use.
func (c *Configurator) OutgoingTLSConfigForCheck(skipVerify bool, serverName string) *tls.Config {
c.log("OutgoingTLSConfigForCheck")
@@ -875,13 +888,9 @@ func (c *Configurator) OutgoingTLSConfigForCheck(skipVerify bool, serverName str
}
}
- if serverName == "" {
- serverName = c.serverNameOrNodeName()
- }
config := c.internalRPCTLSConfig(false)
config.InsecureSkipVerify = skipVerify
config.ServerName = serverName
-
return config
}
diff --git a/tlsutil/config_test.go b/tlsutil/config_test.go
index 30ebd62c206b7..721198afe83bf 100644
--- a/tlsutil/config_test.go
+++ b/tlsutil/config_test.go
@@ -1376,7 +1376,7 @@ func TestConfigurator_OutgoingTLSConfigForCheck(t *testing.T) {
},
},
{
- name: "agent tls, default server name",
+ name: "agent tls, default consul server name, no override",
conf: func() (*Configurator, error) {
return NewConfigurator(Config{
InternalRPC: ProtocolConfig{
@@ -1389,11 +1389,11 @@ func TestConfigurator_OutgoingTLSConfigForCheck(t *testing.T) {
},
expected: &tls.Config{
MinVersion: tls.VersionTLS12,
- ServerName: "servername",
+ ServerName: "",
},
},
{
- name: "agent tls, skip verify, node name for server name",
+ name: "agent tls, skip verify, consul node name for server name, no override",
conf: func() (*Configurator, error) {
return NewConfigurator(Config{
InternalRPC: ProtocolConfig{
@@ -1407,7 +1407,7 @@ func TestConfigurator_OutgoingTLSConfigForCheck(t *testing.T) {
expected: &tls.Config{
InsecureSkipVerify: true,
MinVersion: tls.VersionTLS12,
- ServerName: "nodename",
+ ServerName: "",
},
},
{
diff --git a/website/content/docs/connect/native/go.mdx b/website/content/docs/connect/native/go.mdx
index df9080f17f74d..e3068058fd1eb 100644
--- a/website/content/docs/connect/native/go.mdx
+++ b/website/content/docs/connect/native/go.mdx
@@ -7,6 +7,13 @@ description: >-
# Service Mesh Native Integration for Go Applications
+