forked from apache/apisix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'apache:master' into master
- Loading branch information
Showing
21 changed files
with
858 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
- name: 🚀 Use Node.js | ||
uses: actions/[email protected].1 | ||
uses: actions/[email protected].2 | ||
with: | ||
node-version: "12.x" | ||
- run: npm install -g [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ jobs: | |
uses: actions/checkout@v4 | ||
|
||
- name: Setup Nodejs env | ||
uses: actions/[email protected].1 | ||
uses: actions/[email protected].2 | ||
with: | ||
node-version: '12' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
--- | ||
title: ocsp-stapling | ||
keywords: | ||
- Apache APISIX | ||
- Plugin | ||
- ocsp-stapling | ||
description: This document contains information about the Apache APISIX ocsp-stapling Plugin. | ||
--- | ||
|
||
<!-- | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
--> | ||
|
||
## Description | ||
|
||
The `ocsp-stapling` Plugin dynamically sets the behavior of [OCSP stapling](https://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_stapling) in Nginx. | ||
|
||
## Enable Plugin | ||
|
||
This Plugin is disabled by default. Modify the config file to enable the plugin: | ||
|
||
```yaml title="./conf/config.yaml" | ||
plugins: | ||
- ... | ||
- ocsp-stapling | ||
``` | ||
After modifying the config file, reload APISIX or send an hot-loaded HTTP request through the Admin API to take effect: | ||
```shell | ||
curl http://127.0.0.1:9180/apisix/admin/plugins/reload -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT | ||
``` | ||
## Attributes | ||
The attributes of this plugin are stored in specific field `ocsp_stapling` within SSL Resource. | ||
|
||
| Name | Type | Required | Default | Valid values | Description | | ||
|----------------|----------------------|----------|---------------|--------------|-----------------------------------------------------------------------------------------------| | ||
| enabled | boolean | False | false | | Like the `ssl_stapling` directive, enables or disables OCSP stapling feature. | | ||
| skip_verify | boolean | False | false | | Like the `ssl_stapling_verify` directive, enables or disables verification of OCSP responses. | | ||
| cache_ttl | integer | False | 3600 | >= 60 | Specifies the expired time of OCSP response cache. | | ||
|
||
## Example usage | ||
|
||
You should create an SSL Resource first, and the certificate of the server certificate issuer should be known. Normally the fullchain certificate works fine. | ||
|
||
Create an SSL Resource as such: | ||
|
||
```shell | ||
curl http://127.0.0.1:9180/apisix/admin/ssls/1 \ | ||
-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d ' | ||
{ | ||
"cert" : "'"$(cat server.crt)"'", | ||
"key": "'"$(cat server.key)"'", | ||
"snis": ["test.com"], | ||
"ocsp_stapling": { | ||
"enabled": true | ||
} | ||
}' | ||
``` | ||
|
||
Next, establish a secure connection to the server, request the SSL/TLS session status, and display the output from the server: | ||
|
||
```shell | ||
echo -n "Q" | openssl s_client -status -connect localhost:9443 -servername test.com 2>&1 | cat | ||
``` | ||
|
||
``` | ||
... | ||
CONNECTED(00000003) | ||
OCSP response: | ||
====================================== | ||
OCSP Response Data: | ||
OCSP Response Status: successful (0x0) | ||
... | ||
``` | ||
To disable OCSP stapling feature, you can make a request as shown below: | ||
```shell | ||
curl http://127.0.0.1:9180/apisix/admin/ssls/1 \ | ||
-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d ' | ||
{ | ||
"cert" : "'"$(cat server.crt)"'", | ||
"key": "'"$(cat server.key)"'", | ||
"snis": ["test.com"], | ||
"ocsp_stapling": { | ||
"enabled": false | ||
} | ||
}' | ||
``` | ||
|
||
## Delete Plugin | ||
|
||
Make sure all your SSL Resource doesn't contains `ocsp_stapling` field anymore. To remove this field, you can make a request as shown below: | ||
|
||
```shell | ||
curl http://127.0.0.1:9180/apisix/admin/ssls/1 \ | ||
-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PATCH -d ' | ||
{ | ||
"ocsp_stapling": null | ||
}' | ||
``` | ||
|
||
Modify the config file `./conf/config.yaml` to disable the plugin: | ||
|
||
```yaml title="./conf/config.yaml" | ||
plugins: | ||
- ... | ||
# - ocsp-stapling | ||
``` | ||
|
||
After modifying the config file, reload APISIX or send an hot-loaded HTTP request through the Admin API to take effect: | ||
|
||
```shell | ||
curl http://127.0.0.1:9180/apisix/admin/plugins/reload -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.