From c3e813df0eaa15565b6d51478610b2b215eea4b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Menrath?= Date: Thu, 3 Oct 2024 15:27:19 +0200 Subject: [PATCH] first commit --- localhost-https-development.php | 47 +++++++++++++++++++++++++++++++++ readme.txt | 17 ++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 localhost-https-development.php create mode 100644 readme.txt diff --git a/localhost-https-development.php b/localhost-https-development.php new file mode 100644 index 0000000..2a1408c --- /dev/null +++ b/localhost-https-development.php @@ -0,0 +1,47 @@ += 3.2.2. ActivityPub plugin tested up to: 3.2.2. + * + * @license AGPL-3.0-or-later + * @package LocalHost_Https_Dev + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore + +/** + * Add a filter for http_request_host_is_external + */ +add_filter( 'http_request_host_is_external', 'activitypub_event_bridge_custom_http_request_host_is_external', 10, 3 ); + +/** + * Add a filter for http_request_host_is_external + * + * @param bool $is_external Whether the request is external. + */ +function activitypub_event_bridge_custom_http_request_host_is_external( $is_external ) { + $is_external = true; + + return $is_external; +} + +/** + * Don't verify ssl certs for testing. + */ +add_filter( 'https_ssl_verify', 'activitypub_event_bridge_dont_verify_local_dev_https', 10, 3 ); + +/** + * Do not verify. + */ +function activitypub_event_bridge_dont_verify_local_dev_https() { + return false; +} diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..b5889bd --- /dev/null +++ b/readme.txt @@ -0,0 +1,17 @@ +=== Localhost https Development === +Contributors: andremenrath +Tags: development +Requires at least: 6.5 +Tested up to: 6.6 +Stable tag: 0.1.0 +Requires PHP: 8.1 +License: AGPL-3.0-or-later +License URI: https://www.gnu.org/licenses/agpl-3.0.html + +Only allows for developing locally https ActivityPub stuff. + +== Description == + +Only allows for developing locally https ActivityPub stuff. + +Used together with https://code.event-federation.eu/Event-Federation/docker