8 – Guzzle POST HTTPS requests return 403. Only forbidden if they are called in PHPUnit tests

On the one hand, I have a remote Drupal 8 (8.8.1) that is operated via HTTPS and has the following endpoint:

MODULENAME.get_notify:
  path: 'MODULENAME/get-notify'
  defaults:
    _controller: 'DrupalMODULENAMEControllerMODULENAMEApiController::get_notify'
    _title: 'Get notification'
  methods:  (POST)
  requirements:
    _access: 'TRUE'

On the client side, I have a Drupal 8 (8.8.2), which is provided via HTTPS and sends a notification via the Guzzle library. This Drupal is local to my computer and is provided via DDEV. Here is the Guzzle petition, which is in a custom module:

$options = (
  'headers' => ('Content-Type' => 'application/json'),
  'json' => $jsonArray,
  'timeout' => 15,
);
$response = $this->httpClient->post($url, $options);

The system works well, except that when running PHPUnit tests (BrowserTestBase) on the affected module, the POST query always returns the following error:

Client error: `POST https://SERVER_DOMAIN/MODULENAME/get-notify` resulted in a `403 Forbidden` response'

Any idea why I'm getting this error message?

Testing – 8 – POST HTTPS requirements for Guzzle POST 403 Only forbidden if called in PHPUnit tests

On the one hand, I have a remote Drupal 8 (8.8.1) that is operated via HTTPS and has the following endpoint:

MODULENAME.get_notify:
  path: 'MODULENAME/get-notify'
  defaults:
    _controller: 'DrupalMODULENAMEControllerMODULENAMEApiController::get_notify'
    _title: 'Get notification'
  methods:  (POST)
  requirements:
    _access: 'TRUE'

On the client side, I have a Drupal 8 (8.8.2), which is provided via HTTPS and sends a notification via the Guzzle library. This Drupal is local to my computer and is provided via DDEV. Here is the Guzzle petition, which is in a custom module:

$options = (
  'headers' => ('Content-Type' => 'application/json'),
  'json' => $jsonArray,
  'timeout' => 15,
);
$response = $this->httpClient->post($url, $options);

The system works well, except that when running PHPUnit tests (BrowserTestBase) on the affected module, the POST query always returns the following error:

Client error: `POST https://SERVER_DOMAIN/MODULENAME/get-notify` resulted in a `403 Forbidden` response'

Any idea why I'm getting this error message?

What is the growth of HTTPS websites in [2020]?

In the past, the number of https (a security socket layer for a domain) was very small. It is Google that gives HTTPS a high priority. It enables websites in the Google search ranking so that users also adapt https to their websites and this number increases from year to year. As a survey, "It was 42 percent a year ago. In addition, 75 percent of MacOS and ChromeOS page loads in the Chrome browser use HTTPS, and 71 of the 100 most popular websites enable HTTPS by default." So you can say that it grows by 50-60% every year.

(tagsToTranslate) Webmaster Forum (t) Internet Marketing (t) Search Engine Optimization (t) Web Design (t) SEO (t) ppc (t) Affiliate Marketing (t) Search Engine Marketing (t) Web Hosting (t) Domain Name ( t) Social media

Install HTTPS / SSL on Apache2.4 on Windows for the local domain

I followed this link https://shellcreeper.com/how-to-create-valid-ssl-in-localhost-for-xampp/ to install https / ssl / tls on Windows for local internal files on Apache2.4 Domain.

For some reason, Firefox and Chrome are not opening my local domain https: // Developerver

Firefox reports errors:
secure connection failed
An error occurred while connecting to the Developer Server. PR_CONNECT_ABORTED_ERROR
The page you are trying to view cannot be displayed because the authenticity of the received data could not be verified.

Chrome reports errors:
This website cannot be reached. The website at https: // Developserver / may be temporarily unavailable or has been permanently moved to a new web address.
ERR_CONNECTION_ABORTED

Port 80, therefore http: // developer server works fine.
I checked if port 443 is open on the server.

Can someone please help how to create a working (intranet) solution with https?

Best wishes,
Aviv

Fingerprint – Can I bypass basic authentication to fingerprint a web server with https or Netcat?

There is a web server that I want to create using httprint.

However, this web server has basic authentication protection for 443. Port 80 does not respond
When I start httpint it says "Unspecified error"

The same thing happens with Netcat. It fails due to basic authentication (ie "connection refused").
If basic authentication is disabled, both Netcat and httprint work fine.

How can I bypass basic authentication for a web server's fingerprint?

Python – Extract links https or http BeatifulSoup

I tried to extract links from the pastebin with one page. It gives me the links, but it gives me unwanted links. Example: / api, / login etc. I only want the https and http links that are Pastebin.

url = "https://psbdmp.ws"
        params = {
          "string": "spotify"
        }
        html = reqs.post(url, data=params).text
        print(html)
        soup = BeautifulSoup(html, 'html.parser')
        for link in soup.findAll('a'):
           links = link.get('href')
           print(links)

mod proxy – apache2 mod_proxy works great for http: // urls and not for https: // urls for curl requests

I have proxy setup with apache2 mod_proxy,
Note: I have not changed the proxy port

When I try curl  -x http://proxyurl:80 -L http://destinationservice.com

Now it works, but if I try https://destinationservice.com

curl  -x http://proxyurl:80 -L https://destinationservice.com
curl: (56) Received HTTP code 500 from proxy after CONNECT

What is the solution to the same.

tls – Diffie-Hellman in https: how are prime numbers selected?

I'm trying to understand https because https uses the Diffie-Hellman method for key exchange and then AES for encryption.

But Diffie-Hellman needs two prime numbers, where do they come from?

Redirection – Drupal 8 – https with and without www in base

I have implemented Drupal 8 based website.

global $ base_url; is used in two different modules.

Module 1:

$content .= $base_url .'/user/role/1';

gives url pattern as:
https://www.example.com/user/role/1

Module 2:

$content .= $base_url .'/services';
gives url pattern as:
https://example.com/services

Do settings or configurations need to be set up to get the same pattern when I call $ base_url?