Skip to content

Commit a1e28b4

Browse files
[TT-16342] Update Gateway and Plugin Compiler to Go 1.25 (#7662)
## Description This PR updates the Tyk Gateway and Plugin Compiler from Go 1.24 to Go 1.25. The following files have been updated: - `go.mod`: Updated Go version directive from `1.24.6` to `1.25` - `.go-version`: Updated from `1.24` to `1.25` - `Dockerfile`: Updated `GO_VERSION` ARG from `1.24` to `1.25` - `.github/workflows/ci-tests.yml`: Updated matrix go-version from `1.24.x` to `1.25.x` - `.github/workflows/plugin-compiler-build.yml`: Updated `GOLANG_CROSS` env from `1.24-bullseye` to `1.25-bullseye` - `.github/workflows/release.yml`: Updated all golang-cross references from `1.24-bullseye` to `1.25-bullseye` and `1.24-bookworm` to `1.25-bookworm` - `ci/images/plugin-compiler/Dockerfile`: Updated base image from `golang-cross:1.24-bullseye` to `golang-cross:1.25-bullseye` ## Related Issue https://tyktech.atlassian.net/browse/TT-16342 ## Motivation and Context This update is part of our commitment to staying current with Go versions to minimize exposure to security vulnerabilities. The update maintains all existing GODEBUG settings which remain valid in Go 1.25. ## How This Has Been Tested - Verified `go mod tidy` runs successfully - Built the main Tyk binary successfully with `go build -o tyk .` - Confirmed the binary runs and reports correct version ## Types of changes - [x] Refactoring or add test (improvements in base code or adds test coverage to functionality) ## Checklist - [x] I ensured that the documentation is up to date - [x] I explained why this PR updates go.mod in detail with reasoning why it's required - [ ] I would like a code coverage CI quality gate exception and have explained why <!---TykTechnologies/jira-linter starts here--> ### Ticket Details <details> <summary> <a href="https://tyktech.atlassian.net/browse/TT-16342" title="TT-16342" target="_blank">TT-16342</a> </summary> | | | |---------|----| | Status | In Dev | | Summary | Update Gateway and Plugin Compiler to Go 1.25 | Generated at: 2026-02-26 16:28:17 </details> <!---TykTechnologies/jira-linter ends here--> --------- Co-authored-by: Ilija Bojanovic <ilijabojanovic@gmail.com>
1 parent 969fde6 commit a1e28b4

8 files changed

Lines changed: 46 additions & 39 deletions

File tree

.github/workflows/ci-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
fail-fast: false
9696
matrix:
9797
redis-version: [7]
98-
go-version: [1.24.x]
98+
go-version: [1.25.x]
9999

100100
env:
101101
REDIS_IMAGE: redis:${{ matrix.redis-version }}

.github/workflows/plugin-compiler-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- "v*"
1212

1313
env:
14-
GOLANG_CROSS: 1.24-bullseye
14+
GOLANG_CROSS: 1.25-bullseye
1515

1616
concurrency:
1717
group: ${{ github.workflow }}-${{ github.ref }}

.github/workflows/release.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ jobs:
4141
fail-fast: false
4242
matrix:
4343
golang_cross:
44-
- 1.24-bullseye
44+
- 1.25-bullseye
4545
include:
46-
- golang_cross: 1.24-bullseye
46+
- golang_cross: 1.25-bullseye
4747
goreleaser: 'ci/goreleaser/goreleaser.yml'
4848
cgo: 1
4949
rpmvers: 'el/7 el/8 el/9 amazon/2 amazon/2023'
@@ -89,7 +89,7 @@ jobs:
8989
mask-aws-account-id: false
9090
- uses: aws-actions/amazon-ecr-login@v2
9191
id: ecr
92-
if: ${{ matrix.golang_cross == '1.24-bullseye' }}
92+
if: ${{ matrix.golang_cross == '1.25-bullseye' }}
9393
with:
9494
mask-password: 'true'
9595
- uses: WarpBuilds/cache@v1
@@ -133,7 +133,7 @@ jobs:
133133
tykio/golang-cross:${{ matrix.golang_cross }} /tmp/build.sh
134134
- name: Docker metadata for ee CI
135135
id: ci_metadata_ee
136-
if: ${{ matrix.golang_cross == '1.24-bullseye' }}
136+
if: ${{ matrix.golang_cross == '1.25-bullseye' }}
137137
uses: docker/metadata-action@v5
138138
with:
139139
images: |
@@ -148,7 +148,7 @@ jobs:
148148
type=semver,pattern={{major}}.{{minor}},prefix=v
149149
type=semver,pattern={{version}},prefix=v
150150
- name: push ee image to CI
151-
if: ${{ matrix.golang_cross == '1.24-bullseye' }}
151+
if: ${{ matrix.golang_cross == '1.25-bullseye' }}
152152
uses: docker/build-push-action@v6
153153
with:
154154
context: "dist"
@@ -182,7 +182,7 @@ jobs:
182182
org.opencontainers.image.vendor=tyk.io
183183
org.opencontainers.image.version=${{ github.ref_name }}
184184
- name: push ee image to prod
185-
if: ${{ matrix.golang_cross == '1.24-bullseye' }}
185+
if: ${{ matrix.golang_cross == '1.25-bullseye' }}
186186
uses: docker/build-push-action@v6
187187
with:
188188
context: "dist"
@@ -199,7 +199,7 @@ jobs:
199199
BUILD_PACKAGE_NAME=tyk-gateway-ee
200200
- name: Docker metadata for std CI
201201
id: ci_metadata_std
202-
if: ${{ matrix.golang_cross == '1.24-bullseye' }}
202+
if: ${{ matrix.golang_cross == '1.25-bullseye' }}
203203
uses: docker/metadata-action@v5
204204
with:
205205
images: |
@@ -214,7 +214,7 @@ jobs:
214214
type=semver,pattern={{major}}.{{minor}},prefix=v
215215
type=semver,pattern={{version}},prefix=v
216216
- name: push std image to CI
217-
if: ${{ matrix.golang_cross == '1.24-bullseye' }}
217+
if: ${{ matrix.golang_cross == '1.25-bullseye' }}
218218
uses: docker/build-push-action@v6
219219
with:
220220
context: "dist"
@@ -248,7 +248,7 @@ jobs:
248248
org.opencontainers.image.vendor=tyk.io
249249
org.opencontainers.image.version=${{ github.ref_name }}
250250
- name: push std image to prod
251-
if: ${{ matrix.golang_cross == '1.24-bullseye' }}
251+
if: ${{ matrix.golang_cross == '1.25-bullseye' }}
252252
uses: docker/build-push-action@v6
253253
with:
254254
context: "dist"
@@ -265,7 +265,7 @@ jobs:
265265
BUILD_PACKAGE_NAME=tyk-gateway
266266
- name: save deb
267267
uses: actions/upload-artifact@v4
268-
if: ${{ matrix.golang_cross == '1.24-bullseye' }}
268+
if: ${{ matrix.golang_cross == '1.25-bullseye' }}
269269
with:
270270
name: deb
271271
retention-days: 1
@@ -275,7 +275,7 @@ jobs:
275275
!dist/*fips*.deb
276276
- name: save rpm
277277
uses: actions/upload-artifact@v4
278-
if: ${{ matrix.golang_cross == '1.24-bullseye' }}
278+
if: ${{ matrix.golang_cross == '1.25-bullseye' }}
279279
with:
280280
name: rpm
281281
retention-days: 1
@@ -605,7 +605,7 @@ jobs:
605605
-e GOMODCACHE=/go/pkg/mod \
606606
-v /tmp/build-dashboard.sh:/tmp/build-dashboard.sh \
607607
-w /go/src/github.com/TykTechnologies/tyk-analytics \
608-
tykio/golang-cross:1.24-bookworm /tmp/build-dashboard.sh
608+
tykio/golang-cross:1.25-bookworm /tmp/build-dashboard.sh
609609
610610
echo "✅ Packages built successfully for $GOARCH"
611611
- name: Detect platform for Docker build

.go-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.24
1+
1.25

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG GO_VERSION=1.24
1+
ARG GO_VERSION=1.25
22
FROM golang:${GO_VERSION}-bullseye
33

44
# Build essentials

ci/images/plugin-compiler/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG BASE_IMAGE=tykio/golang-cross:1.24-bullseye
1+
ARG BASE_IMAGE=tykio/golang-cross:1.25-bullseye
22
FROM ${BASE_IMAGE}
33

44
LABEL description="Image for plugin development"

gateway/cert_test.go

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,15 @@ import (
3939
)
4040

4141
const (
42-
internalTLSErr = "tls: unrecognized name"
43-
badcertErr = "tls: bad certificate"
44-
certNotMatchErr = "Client TLS certificate is required"
45-
unknownCertAuthorityErr = "unknown certificate authority"
42+
internalTLSErr = "tls: unrecognized name"
43+
certNotMatchErr = "Client TLS certificate is required"
44+
// Go 1.25 TLS error strings for mutual TLS scenarios:
45+
// When ClientCA is announced: no cert → handshake failure, wrong cert → unknown certificate authority
46+
// When ClientCA is skipped: no cert → bad certificate, wrong cert → bad certificate
47+
noCertAnnounceErr = "tls: handshake failure"
48+
wrongCertAnnounceErr = "tls: unknown certificate authority"
49+
noCertSkipAnnounceErr = "tls: bad certificate"
50+
wrongCertSkipAnnounceErr = "tls: bad certificate"
4651
)
4752

4853
func TestGatewayTLS(t *testing.T) {
@@ -207,7 +212,7 @@ func TestGatewayControlAPIMutualTLS(t *testing.T) {
207212
// Should raise error for ControlAPI without certificate
208213
{ControlRequest: true, ErrorMatch: unknownErr},
209214
// Should raise error for unknown certificate
210-
{ControlRequest: true, ErrorMatch: unknownCertAuthorityErr, Client: clientWithCert},
215+
{ControlRequest: true, ErrorMatch: wrongCertAnnounceErr, Client: clientWithCert},
211216
}...)
212217
})
213218

@@ -259,7 +264,7 @@ func TestGatewayControlAPIMutualTLS(t *testing.T) {
259264

260265
// Should fail as no valid cert IDs exist in Certificates.ControlAPI
261266
_, _ = ts.Run(t, test.TestCase{
262-
Path: "/tyk/certs", Code: http.StatusForbidden, ErrorMatch: unknownCertAuthorityErr, ControlRequest: true, AdminAuth: true, Client: clientWithCert,
267+
Path: "/tyk/certs", Code: http.StatusForbidden, ErrorMatch: wrongCertAnnounceErr, ControlRequest: true, AdminAuth: true, Client: clientWithCert,
263268
})
264269
})
265270

@@ -378,9 +383,11 @@ func testAPIMutualTLSHelper(t *testing.T, skipCAAnnounce bool) {
378383
serverCertPem, _, combinedPEM, _ := crypto.GenServerCertificate()
379384
certID, _, _ := certs.GetCertIDAndChainPEM(combinedPEM, "")
380385

381-
expectedCertErr := unknownCertAuthorityErr
386+
expectedNoCertErr := noCertAnnounceErr
387+
expectedWrongCertErr := wrongCertAnnounceErr
382388
if skipCAAnnounce {
383-
expectedCertErr = badcertErr
389+
expectedNoCertErr = noCertSkipAnnounceErr
390+
expectedWrongCertErr = wrongCertSkipAnnounceErr
384391
}
385392

386393
conf := func(globalConf *config.Config) {
@@ -465,7 +472,7 @@ func testAPIMutualTLSHelper(t *testing.T, skipCAAnnounce bool) {
465472
})
466473

467474
_, _ = ts.Run(t, test.TestCase{
468-
ErrorMatch: badcertErr,
475+
ErrorMatch: expectedNoCertErr,
469476
Client: client,
470477
Domain: "localhost",
471478
})
@@ -492,7 +499,7 @@ func testAPIMutualTLSHelper(t *testing.T, skipCAAnnounce bool) {
492499

493500
client = GetTLSClient(&clientCert, serverCertPem)
494501
_, _ = ts.Run(t, test.TestCase{
495-
Client: client, Domain: "localhost", ErrorMatch: expectedCertErr,
502+
Client: client, Domain: "localhost", ErrorMatch: expectedWrongCertErr,
496503
})
497504
})
498505

@@ -511,7 +518,7 @@ func testAPIMutualTLSHelper(t *testing.T, skipCAAnnounce bool) {
511518
})
512519

513520
_, _ = ts.Run(t, test.TestCase{
514-
Client: client, ErrorMatch: expectedCertErr, Domain: "localhost",
521+
Client: client, ErrorMatch: expectedWrongCertErr, Domain: "localhost",
515522
})
516523
})
517524
})
@@ -633,13 +640,13 @@ func testAPIMutualTLSHelper(t *testing.T, skipCAAnnounce bool) {
633640
Path: "/with_mutual",
634641
Client: clientWithoutCert,
635642
Domain: domain,
636-
ErrorMatch: badcertErr,
643+
ErrorMatch: expectedNoCertErr,
637644
},
638645
{
639646
Path: "/with_mutual_2",
640647
Client: clientWithoutCert,
641648
Domain: domain,
642-
ErrorMatch: badcertErr,
649+
ErrorMatch: expectedNoCertErr,
643650
},
644651
}...)
645652
})
@@ -653,14 +660,14 @@ func testAPIMutualTLSHelper(t *testing.T, skipCAAnnounce bool) {
653660
Path: "/with_mutual",
654661
Client: client,
655662
Domain: domain,
656-
ErrorMatch: expectedCertErr,
663+
ErrorMatch: expectedWrongCertErr,
657664
})
658665

659666
_, _ = ts.Run(t, test.TestCase{
660667
Path: "/with_mutual_2",
661668
Client: client,
662669
Domain: domain,
663-
ErrorMatch: expectedCertErr,
670+
ErrorMatch: expectedWrongCertErr,
664671
})
665672
})
666673

@@ -749,7 +756,7 @@ func testAPIMutualTLSHelper(t *testing.T, skipCAAnnounce bool) {
749756
Path: "/with_mutual",
750757
Client: clientWithoutCert,
751758
Domain: domain,
752-
ErrorMatch: badcertErr,
759+
ErrorMatch: expectedNoCertErr,
753760
})
754761
}
755762

@@ -779,7 +786,7 @@ func testAPIMutualTLSHelper(t *testing.T, skipCAAnnounce bool) {
779786
Path: "/with_mutual",
780787
Client: client,
781788
Domain: domain,
782-
ErrorMatch: expectedCertErr,
789+
ErrorMatch: expectedWrongCertErr,
783790
})
784791
}
785792
})
@@ -842,7 +849,7 @@ func testAPIMutualTLSHelper(t *testing.T, skipCAAnnounce bool) {
842849
_, _ = ts.Run(t, test.TestCase{
843850
Path: "/with_mutual",
844851
Client: clientWithoutCert,
845-
ErrorMatch: badcertErr,
852+
ErrorMatch: expectedNoCertErr,
846853
})
847854
}
848855

@@ -871,7 +878,7 @@ func testAPIMutualTLSHelper(t *testing.T, skipCAAnnounce bool) {
871878
_, _ = ts.Run(t, test.TestCase{
872879
Path: "/with_mutual",
873880
Client: client,
874-
ErrorMatch: expectedCertErr,
881+
ErrorMatch: expectedWrongCertErr,
875882
})
876883
}
877884
})
@@ -1886,7 +1893,7 @@ func TestCipherSuites(t *testing.T) {
18861893
MaxVersion: tls.VersionTLS12,
18871894
}}}
18881895

1889-
_, _ = ts.Run(t, test.TestCase{Client: client, Path: "/", ErrorMatch: "tls: handshake failure"})
1896+
_, _ = ts.Run(t, test.TestCase{Client: client, Path: "/", ErrorMatch: noCertAnnounceErr})
18901897
})
18911898
}
18921899

@@ -2004,7 +2011,7 @@ func TestClientCertificates_WithProtocolTLS(t *testing.T) {
20042011
// client
20052012
t.Run("bad certificate", func(t *testing.T) {
20062013
_, err := tls.Dial("tcp", apiAddr, mTLSConfig)
2007-
assert.ErrorContains(t, err, badcertErr)
2014+
assert.ErrorContains(t, err, noCertAnnounceErr)
20082015
})
20092016

20102017
t.Run("correct certificate", func(t *testing.T) {

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/TykTechnologies/tyk
22

3-
go 1.24.6
3+
go 1.25
44

55
godebug (
66
tls10server=1

0 commit comments

Comments
 (0)