This file contains hidden or 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
#!/usr/bin/perl | |
### | |
### Writes a list of 'set_real_ip_from' directives based on current CloudFlare proxy IP addresses. | |
### This is used to ensure the real client IP is known by NGINX and correctly logged. | |
### Script usage: /etc/nginx/nginx_cloudflare_ip_headers.pl --silent --update-hook '/usr/sbin/nginx -s reload' '/etc/nginx/snippets/cloudflare_real_ip_header.conf' | |
### NOTE: Additional perl packages are required to run this script, use 'apt install libwww-perl libjson-perl libreadonly-perl perl-doc' | |
### Don't forget to add execute permissions too! chmod ug+x /etc/nginx/nginx_cloudflare_ip_headers.pl | |
use strict; |
This file contains hidden or 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
<# | |
.SYNOPSIS | |
Gets the certificate information for a given host using System.Net.Sockets.TcpClient | |
.DESCRIPTION | |
Gets the certificate information for a given host, optionally outputting x509 certificate and extended certificate information. | |
.PARAMETER HostName | |
The host to connect to. | |
.PARAMETER SniHostName | |
When the host uses SNI, this authenticates based on the specified SniHostName. | |
.PARAMETER Port |