docs/en/docs/rules/sniCallback.md
Dynamically customize the TLS certificate used in HTTPS requests through a plugin mechanism.
pattern sniCallback://plugin-name(sniValue) [filters...]
(sniValue)is optional and can be obtained viareq.originalReq.sniValuein the plugin hook.
| Parameters | Description | Detailed Documentation |
|---|---|---|
| pattern | An expression to match the request URL | Match Pattern Documentation |
| plugin-name(sniValue) | Plugin name + optional parameters | |
| filters | Optional filters, supporting matching: | |
| • Request URL/Method/Headers/Content | ||
| • Response Status Code/Headers | Filters Documentation |
wwww.example.com sniCallback://test
wwww.example.com sniCallback://test-sni(abc)
Access SNI information in the plugin through the following properties:
exports.auth = (req) => {
const { sniValue, servername } = req.originalReq; // Get configuration parameters and servername
return {
cert: /* Certificate content */,
key: /* Private key content */
}
};
For specific usage, refer to Plugin Development Documentation