Skip to content

Commit

Permalink
Add a "nopkcs11" build tag
Browse files Browse the repository at this point in the history
This allows opting out of PKCS11 (to avoid needing libltdl), but with CGO still
enabled so certstore is usable

~ CGO_ENABLED=1 go build -tags "nopkcs11 certstore"
~ otool -L ./ghostunnel
./ghostunnel:
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1570.15.0)
	/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 58286.251.4)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1)
  • Loading branch information
mcpherrinm committed May 13, 2019
1 parent f2ffa57 commit 906c997
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ before_install:
install:
# Compile with CGO on/off for testing
- CGO_ENABLED=0 go build -o ghostunnel-${TRAVIS_TAG}-linux-amd64-without-pkcs11 .
- CGO_ENABLED=1 go build -tags nopkcs11 -o ghostunnel-${TRAVIS_TAG}-linux-amd64-without-pkcs11-but-with-cgo .
- CGO_ENABLED=1 go build -o ghostunnel-${TRAVIS_TAG}-linux-amd64-with-pkcs11 .
# Build Docker container
- make docker-build
Expand Down
2 changes: 1 addition & 1 deletion certloader/pkcs11_disabled.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build !cgo
// +build !cgo nopkcs11

/*-
* Copyright 2018 Square Inc.
Expand Down
2 changes: 1 addition & 1 deletion certloader/pkcs11_enabled.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build cgo
// +build cgo,!nopkcs11

/*-
* Copyright 2018 Square Inc.
Expand Down

0 comments on commit 906c997

Please sign in to comment.