Skip to content

[Bug]: Regression when using Firefox profile #194

@jsnjack

Description

@jsnjack

TLS client version

v1.11.0

System information

  • Linux, Fedora 42

Issue description

tls: invalid server key share error when using Firefox profile (f.e. firefox 135) and trying to establish tls connection with the server which uses key_share secp256r1(CurveP256). This is a regression as the same code works fine in v1.9.2.

Steps to reproduce / Code Sample

  1. Select the latest firefox profile (135) and make a request to https://sts-fips.us-east-1.amazonaws.com
  2. The request will fail with tls: invalid server key share error

Code example

package main

import (
	"fmt"
	"io"
	"log"

	http "github.com/bogdanfinn/fhttp"
	tls_client "github.com/bogdanfinn/tls-client"
	"github.com/bogdanfinn/tls-client/profiles"
)

func main() {
	options := []tls_client.HttpClientOption{
		tls_client.WithClientProfile(profiles.Firefox_135),
		tls_client.WithNotFollowRedirects(),
	}

	client, err := tls_client.NewHttpClient(tls_client.NewNoopLogger(), options...)
	if err != nil {
		log.Println(err)
		return
	}

	req, err := http.NewRequest(http.MethodGet, "https://sts-fips.us-east-1.amazonaws.com", nil)
	if err != nil {
		log.Println(err)
		return
	}

	resp, err := client.Do(req)
	if err != nil {
		log.Println(err)
		return
	}

	defer resp.Body.Close()

	fmt.Println("status code:", resp.StatusCode)

	readBytes, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Println(err)
		return
	}

	log.Println(string(readBytes))
}

go.mod file for version in which the bug is present:

module example

go 1.24.6

require (
	github.com/bogdanfinn/fhttp v0.6.1
	github.com/bogdanfinn/tls-client v1.11.0
)

require (
	github.com/Dharmey747/quic-go-utls v1.0.3-utls // indirect
	github.com/andybalholm/brotli v1.1.1 // indirect
	github.com/bogdanfinn/utls v1.7.3-barnius // indirect
	github.com/cloudflare/circl v1.5.0 // indirect
	github.com/klauspost/compress v1.17.11 // indirect
	github.com/quic-go/qpack v0.5.1 // indirect
	github.com/tam7t/hpkp v0.0.0-20160821193359-2b70b4024ed5 // indirect
	go.uber.org/mock v0.5.0 // indirect
	golang.org/x/crypto v0.36.0 // indirect
	golang.org/x/mod v0.18.0 // indirect
	golang.org/x/net v0.38.0 // indirect
	golang.org/x/sync v0.12.0 // indirect
	golang.org/x/sys v0.31.0 // indirect
	golang.org/x/text v0.23.0 // indirect
	golang.org/x/tools v0.22.0 // indirect
)

go.mod file for version which works:

module example

go 1.24.6

require (
	github.com/bogdanfinn/fhttp v0.5.36
	github.com/bogdanfinn/tls-client v1.9.2
)

require (
	github.com/andybalholm/brotli v1.1.1 // indirect
	github.com/bogdanfinn/utls v1.6.5 // indirect
	github.com/cloudflare/circl v1.5.0 // indirect
	github.com/klauspost/compress v1.17.11 // indirect
	github.com/quic-go/quic-go v0.48.1 // indirect
	github.com/tam7t/hpkp v0.0.0-20160821193359-2b70b4024ed5 // indirect
	golang.org/x/crypto v0.36.0 // indirect
	golang.org/x/net v0.38.0 // indirect
	golang.org/x/sys v0.31.0 // indirect
	golang.org/x/text v0.23.0 // indirect
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions