Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to disable SSL verification in curl commands #166

Closed
dfineSvenFlock opened this issue Jul 30, 2024 · 12 comments
Closed

How to disable SSL verification in curl commands #166

dfineSvenFlock opened this issue Jul 30, 2024 · 12 comments

Comments

@dfineSvenFlock
Copy link

dfineSvenFlock commented Jul 30, 2024

Hi,

I need a little help in some configuration of your extension:

I am using LetsEncrypt staging certificates for my Keycloak instance in development. Thus, I am getting the following error due to not trustworthy SSL certificates when talking to the service:

Screenshot 2024-07-30 at 21 08 44

I already googled for the problem but the usual trick doesn't work:

<?php
$GLOBALS['TYPO3_CONF_VARS']['HTTP']['verify'] = false;

I have verified that the setting is properly applied. Thus, I think that the plugin does not take the global setting into account or must be configured separately. I am looking for the "-k" switch in curl in our extension.

Using official LetsEncrypt certificates work fine and no error is thrown.

Can you tell me which setting I have to make?

Thanks,
Sven

@liayn
Copy link
Collaborator

liayn commented Jul 31, 2024

Hi! That's correct, we lack initialization of the provider in GenericOAuthProviderFactory with $collaborators where we can specify our own HTTP client (which would adhere to the TYPO3_CONF_VARS

@liayn liayn added the bug label Jul 31, 2024
liayn added a commit to liayn/t3ext-oidc that referenced this issue Jul 31, 2024
In order to adhere to global guzzle TYPO3 settings
the OAuth provider is extended to pass the necessary
factories along.

Related xperseguers#166
@liayn liayn self-assigned this Jul 31, 2024
@liayn
Copy link
Collaborator

liayn commented Jul 31, 2024

@dfineSvenFlock please test my patch as linked above. (I did not test it)
If it works for you, I'll create a pull request.

liayn added a commit to liayn/t3ext-oidc that referenced this issue Jul 31, 2024
In order to adhere to global guzzle TYPO3 settings
the OAuth provider is extended to pass the necessary
factories along.

Related xperseguers#166
@NimaJa1372
Copy link

We tested the patch.

The following error occurs on the page where the oidc plugin is embedded, and we are not redirected to the oidc server:
image

And this is the log:
Wed, 31 Jul 2024 10:01:08 +0000 [ALERT] request="93d89ed278434" component="TYPO3.CMS.Frontend.ContentObject.Exception.ProductionExceptionHandler": Oops, an error occurred! Code: 202407311001085c4c5b57- Exception: Too few arguments to function Causal\Oidc\Factory\GenericOAuthProviderFactory::__construct(), 0 passed in /var/www/clients/client0/web15/web/vendor/typo3/cms-core/Classes/Utility/GeneralUtility.php on line 2985 and exactly 1 expected, in file /var/www/clients/client0/web15/web/vendor/typo3/cms-frontend/Classes/ContentO>

liayn added a commit to liayn/t3ext-oidc that referenced this issue Jul 31, 2024
In order to adhere to global guzzle TYPO3 settings
the OAuth provider is extended to pass the necessary
factories along.

Related xperseguers#166
@liayn
Copy link
Collaborator

liayn commented Jul 31, 2024

Okay, GenericOAuthProviderFactory needs to be public service.
I adjusted the patch (force pushed). Can you please try again?

@NimaJa1372
Copy link

Unfortunately it did not work. I get the same error

@liayn
Copy link
Collaborator

liayn commented Jul 31, 2024

Did you clear caches via Install Tool?

@NimaJa1372
Copy link

I just did it. Now, i get this error:

Wed, 31 Jul 2024 11:23:26 +0000 [ALERT] request="8bc66e39bec3e" component="TYPO3.CMS.Frontend.ContentObject.Exception.ProductionExceptionHandler": Oops, an error occurred! Code: 202407311123264bd2dc42- Exception: Non-static method TYPO3\CMS\Core\Http\Client\GuzzleClientFactory::getClient() cannot be called statically, in file /var/www/clients/client0/web15/web/vendor/typo3/cms-frontend/Classes/ContentObject/ContentObjectRenderer.php:722 - {"exception":"Error: Non-static method TYPO3\\CMS\\Core\\Http\\Client\\GuzzleClientFactory::getClient() cannot be called statically in /var/www/clients/client0/web15/web/packages/oidc/Classes/Factory/GenericOAuthProviderFactory.php:37\nStack trace:\n#0 /var/www/clients/client0/web15/web/packages/oidc/Classes/Service/OAuthService.php(229): Causal\\Oidc\\Factory\\GenericOAuthProviderFactory->create()\n#1 /var/www/clients/client0/web15/web/packages/oidc/Classes/Service/OAuthService.php(74): Causal\\Oidc\\Service\\OAuthService->getProvider()\n#2 /var/www/clients/client0/web15/web/packages/oidc/Classes/Controller/>

@liayn
Copy link
Collaborator

liayn commented Jul 31, 2024

Which TYPO3 version are you using? (v12 support is not yet official, my patch is v11 only)

@liayn
Copy link
Collaborator

liayn commented Jul 31, 2024

The reason for you error is probably this breaking change in Core: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73271/7/typo3/sysext/core/Classes/Http/Client/GuzzleClientFactory.php

liayn added a commit to liayn/t3ext-oidc that referenced this issue Jul 31, 2024
In order to adhere to global guzzle TYPO3 settings
the OAuth provider is extended to pass the necessary
factories along.

Related xperseguers#166
@liayn
Copy link
Collaborator

liayn commented Jul 31, 2024

I pushed a new version of the patch, which should also work with v12

@NimaJa1372
Copy link

I use v12. It works now. Thanks a lot!

@dfineSvenFlock
Copy link
Author

@liayn Big thanks from my side as well! I will close the issue. Please make a PR and also we are quite looking into the PR for v12 support :-).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants