• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

TykTechnologies / tyk / 3078 / 2
47%
master: %

Build:
Build:
LAST BUILD BRANCH: v2.9.4.8
DEFAULT BRANCH: master
Ran 24 Sep 2017 12:14PM UTC
Files 87
Run time 3s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

24 Sep 2017 12:10PM UTC coverage: 45.737% (+0.4%) from 45.333%
LATEST_GO=true

push

travis-ci

buger
Mutual TLS protection on API Level

Mutual TLS authorization happens on handshake level, so we can make it
our regular middleware. Whole idea of mutual TLS auth is that our
server acts as certification authority and store list of allowed client
certificates, discarding the rest.

Go 1.8 added handy helper for tls.Config called `GetConfigForClient`,
which allow loading different TLS configurations for each client based
on handshake `hello` info. The only attribute of hello payload can be
used for our case is `ServerName`. Note: TLS is separate protocol from
HTTP, so it does not include notion of hostname, and `ServerName` we
have is actually SNI extension added quite long ago, and supported by
most of the clients.

By having access to ServerName we can enable Mutual TLS per API, based
on APISpec.Domain. The only requirement is that each API which use
Mutual TLS should have own domain.

API spec now include 2 new fields `use_mutual_tls_auth` and
`mutual_tls_certificate` with actual certificate. Certificate should be
PEM encoded. Note that Certificate is not the same as public/private
key, but it is based on them.

You can create self-signed client and server certificates with this
command: `openssl req -x509 -newkey rsa:4096 -keyout key.pem -out
cert.pem -days 365`

For the server in common name specify domain, or just pass `-subj
'/CN=localhost’` to openssl command. After follow
https://www.tyk.io/docs/security/tls-and-ssl/ guide.

If you testing using `curl` command may look like:
`curl  —cert client_cert.pem --key client_key.pem
https://localhost:8181`

First part of #357

gofmt

Add new mutual tls configuration (doc to be extended)

Add new mutual tls configuration (doc to be extended)

6282 of 13735 relevant lines covered (45.74%)

0.5 hits per line

Source Files on job 3078.2 (LATEST_GO=true)
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 3078
  • Travis Job 3078.2
  • f3580ac2 on github
  • Prev Job for LATEST_GO=true on mutual_tls (#3076.2)
  • Next Job for LATEST_GO=true on mutual_tls (#3080.2)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc