Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
038e4d2
Update README
akoserwal Nov 12, 2019
2bc4eb0
Update READMe
akoserwal Nov 12, 2019
4eec5ed
replace frozen crypto/pkcs12
Hermsi1337 Apr 16, 2024
c35fe53
use decodeChain and add caCertificates to certs-array
Hermsi1337 Apr 16, 2024
12a0add
Merge pull request #1055 from akoserwal/master
nickysemenza Jul 11, 2024
2adc622
Create semgrep.yml
hrushikeshdeshpande Sep 22, 2024
d3645c1
Update semgrep.yml
hrushikeshdeshpande Sep 25, 2024
91b63b5
Merge pull request #1395 from cloudflare/hrushikeshdeshpande-creating…
nickysemenza Oct 15, 2024
1a73d78
Upgrade certificate-transparency-go from v1.1.8 to v1.3.1
mitch292 Feb 7, 2025
cb0a0a3
Merge pull request #1408 from mitch292/mitch292/certificate-transpare…
vasilzhigilei Feb 7, 2025
14f61be
Revert "Upgrade certificate-transparency-go from v1.1.8 to v1.3.1"
mitch292 Feb 8, 2025
730ee58
Merge pull request #1409 from mitch292/mitch292/revert-ct-go-upgrade
mitch292 Feb 10, 2025
faaff55
Fixes #1237 partially by updating test data certificates to be valid
mitch292 Feb 8, 2025
1c1bc0b
Merge pull request #1410 from mitch292/mitch292/1237-fix-test-cases
mitch292 Feb 11, 2025
dd8f9ef
Github actions linter uses golangci-lint@v1.57
mitch292 Feb 13, 2025
6d2d0b2
Merge pull request #1412 from mitch292/mitch292/fix-linting
mitch292 Feb 14, 2025
a40f86c
Update repository to reflect required min go version of 1.20
mitch292 Feb 14, 2025
b898d2f
Merge pull request #1415 from mitch292/mitch292/go-version
mitch292 Feb 14, 2025
cd8a4de
ignore .git to .dockerignore
mschwarzl Feb 26, 2025
ed8df49
Merge pull request #1416 from cloudflare/mschwarzl/dockerignore
mschwarzl Feb 26, 2025
de3c0c1
Merge branch 'dep/replace-pkcs12-library' of https://github.com/Herms…
Hermsi1337 Jun 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ cfssl_*
*-amd64
*-386
dist/*
.git
18 changes: 14 additions & 4 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go: [stable, oldstable]
# starting with go 1.24 the GODEBUG=x509sha1=1 flag has been removed.
# many tests rely on sha1 certificates. After resolving #1413 we can
# run these on stable and oldstable again. Min version (1.20) can
# always be run.
go: ['1.23', '1.22', '1.20']
services:
# Label used to access the service container
postgres:
Expand Down Expand Up @@ -70,9 +74,15 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.18
- uses: actions/checkout@v4
go-version: "1.20"
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
uses: golangci/golangci-lint-action@v6
with:
# There is a breaking change in 1.58 that causes the linter not to recognize
# internal imports or standard library imports and results in linting errors
# that cannot be ignored.
# e.g certdb/certdb.go:5:2: could not import encoding/json (Config.Importer.Import(encoding/json) returned nil but no error) (typecheck)
version: v1.57
24 changes: 24 additions & 0 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
pull_request: {}
workflow_dispatch: {}
push:
branches:
- main
- master
schedule:
- cron: '0 0 * * *'
name: Semgrep config
jobs:
semgrep:
name: semgrep/ci
runs-on: ubuntu-latest
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
SEMGREP_URL: https://cloudflare.semgrep.dev
SEMGREP_APP_URL: https://cloudflare.semgrep.dev
SEMGREP_VERSION_CHECK_URL: https://cloudflare.semgrep.dev/api/check-version
container:
image: semgrep/semgrep
steps:
- uses: actions/checkout@v4
- run: semgrep ci
2 changes: 0 additions & 2 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@ linters:
- gosimple
- ineffassign
- unused
- deadcode
- errcheck
- varcheck
2 changes: 1 addition & 1 deletion Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.16.15-alpine3.15@sha256:9743f230f26d1e300545f0330fd4a514f554c535d967563ee77bf634906502b6 as builder
FROM golang:1.20-alpine AS builder

WORKDIR /workdir
COPY . /workdir
Expand Down
11 changes: 2 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ snapshot:
--rm \
-v $(PWD):/cross \
-w /cross \
ghcr.io/goreleaser/goreleaser-cross:latest --clean --snapshot --skip-publish
ghcr.io/goreleaser/goreleaser-cross:latest --clean --snapshot --skip=publish

.PHONY: github-release
github-release:
Expand All @@ -73,15 +73,8 @@ github-release:
-w /cross \
ghcr.io/goreleaser/goreleaser-cross:latest --clean

.PHONY: docker-build
docker-build:
docker build -f Dockerfile -t cfssl/cfssl:$(VERSION) .
.PHONY: docker-push
docker-push:
docker push cfssl/cfssl:$(VERSION)

.PHONY: release
release: github-release docker-build docker-push
release: github-release

BUILD_PATH := $(CURDIR)/build
INSTALL_PATH := $(BUILD_PATH)/usr/local/bin
Expand Down
30 changes: 4 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

CFSSL is CloudFlare's PKI/TLS swiss army knife. It is both a command line
tool and an HTTP API server for signing, verifying, and bundling TLS
certificates. It requires Go 1.16+ to build.
certificates. It requires Go 1.20+ to build.

Note that certain linux distributions have certain algorithms removed
(RHEL-based distributions in particular), so the golang from the
Expand All @@ -30,12 +30,13 @@ CFSSL consists of:
### Building

Building cfssl requires a
[working Go 1.16+ installation](http://golang.org/doc/install).
[working Go 1.20+ installation](http://golang.org/doc/install).

```
$ git clone git@github.com:cloudflare/cfssl.git
$ cd cfssl
$ make
$ make install
```

The resulting binaries will be in the bin folder:
Expand All @@ -60,32 +61,9 @@ You can set the `GOOS` and `GOARCH` environment variables to have Go cross compi

### Installation

Installation requires a [working Go 1.16+ installation](http://golang.org/doc/install).
Installation requires a [working Go 1.20+ installation](http://golang.org/doc/install).
Alternatively, [prebuilt binaries are available](https://github.com/cloudflare/cfssl/releases)

```
$ go get github.com/cloudflare/cfssl/cmd/cfssl
```

will download, build, and install the CFSSL tool.

To install any of the other utility programs that are
in this repo (for instance `cfssljson` in this case):

```
$ go get github.com/cloudflare/cfssl/cmd/cfssljson
```

This will download, build, and install the CFSSLJSON tool.

And to simply install __all__ of the programs in this repo:

```
$ go get github.com/cloudflare/cfssl/cmd/...
```

if you are above go 1.18:

```
$ go install github.com/cloudflare/cfssl/cmd/...@latest
```
Expand Down
1 change: 0 additions & 1 deletion api/bundle/bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ var bundleTests = []bundleTest{
}

func TestBundle(t *testing.T) {
t.Skip("expired cert https://github.com/cloudflare/cfssl/issues/1237")
for i, test := range bundleTests {
resp, body := testBundleFile(t, test.Domain, test.IP, test.CertFile, test.KeyFile, test.Flavor)
if resp.StatusCode != test.ExpectedHTTPStatus {
Expand Down
31 changes: 16 additions & 15 deletions api/testdata/ca-bundle.pem
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
-----BEGIN CERTIFICATE-----
MIICyDCCAjGgAwIBAgIJAPCgd7rafQZGMA0GCSqGSIb3DQEBBQUAMH0xCzAJBgNV
BAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1TYW4gRnJhbmNp
c2NvMRMwEQYDVQQKDApDbG91ZEZsYXJlMRQwEgYDVQQLDAtERVZfVEVTVElORzEW
MBQGA1UEAwwNQ0ZTU0xfVEVTVF9DQTAeFw0xNDA0MTExNjQyMjBaFw0yNDA0MDgx
NjQyMjBaMH0xCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYD
VQQHDA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AYDVQQDDA1DRlNTTF9URVNUX0NB
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCbp/6OQ/a3mr+8zRgBRlmSGr8Q
BgP4vUIxLn2Mk4uiZ8OcpRY4YqL+TtREGDUc0ve+bv8RINrNlYXL2X+eJtbE2RJQ
+RAiu+saw2K+RFTNeTCA1fwg3ws5gBDcFbECqK1dOkuN/gV4JMHobn2/15iUBfeS
JxdF1j5yqES8sVu7cwIDAQABo1MwUTAdBgNVHQ4EFgQUuF7vrmdQt9bzB+VqvlWz
ZzoNkj4wHwYDVR0jBBgwFoAUuF7vrmdQt9bzB+VqvlWzZzoNkj4wDwYDVR0TAQH/
BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOBgQALmrNPUPlCyhabvgC8RsMZPhJjtxr9
TotLuoa49zsHH18djRZLrm8mNzBwUVVNJ1hgwSpRnyrc7T4HQTTvjpCnyXEVRil/
9HQbpVPBSw5W6oK3koLG0rFnZXHocqK+Qri4FkbwsTK5qlea35OJWkODiUY/ykVM
E4sm6QDE79e0Iw==
-----END CERTIFICATE-----
2 changes: 0 additions & 2 deletions bundler/bundle_from_remote_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ var remoteTests = []remoteTest{

// TestBundleFromRemote goes through the test cases defined in remoteTests and run them through. See above for test case definitions.
func TestBundleFromRemote(t *testing.T) {
t.Skip("expired cert https://github.com/cloudflare/cfssl/issues/1237")
for _, bf := range []BundleFlavor{Ubiquitous, Optimal} {
for _, test := range remoteTests {
b := test.bundlerConstructor(t)
Expand Down Expand Up @@ -164,7 +163,6 @@ var remoteSNITests = []remoteTest{

// TestBundleFromRemoteSNI goes through the test cases defined in remoteSNITests and run them through. See above for test case definitions.
func TestBundleFromRemoteSNI(t *testing.T) {
t.Skip("expired cert https://github.com/cloudflare/cfssl/issues/1237")
for _, bf := range []BundleFlavor{Ubiquitous, Optimal} {
for _, test := range remoteSNITests {
b := test.bundlerConstructor(t)
Expand Down
1 change: 0 additions & 1 deletion bundler/bundler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,6 @@ func TestBundlerWithEmptyRootInfo(t *testing.T) {
}

func TestBundlerClientAuth(t *testing.T) {
t.Skip("expired cert https://github.com/cloudflare/cfssl/issues/1237")
b, err := NewBundler("testdata/client-auth/root.pem", "testdata/client-auth/int.pem")
if err != nil {
t.Fatal(err)
Expand Down
Loading