Skip to content

metarefresh incompatible with SSP 2.5.0: Unsupported option "http" passed to "Symfony\Component\HttpClient\CurlHttpClient" #62

Closed

Description

@msalle

With the full source tarball for SSP 2.5.0 I get an error

metarefresh: Unsupported option "http" passed to "Symfony\Component\HttpClient\CurlHttpClient", did you mean "http_version"?

My guess is this comes from
metarefresh's src/MetaLoader.php line 403
which needs adapting for the new Symfony version 7.4 included with 2.5.0, along the lines of simplesamlphp/simplesamlphp#2574 ?

Activity

  1. tvdijen commented on Mar 15, 2026

    @tvdijen
    Member

    Thanks @msalle ! Would you be able to run a test with the suggested fix in #63 ?
    You can install it by running bin/composer simplesamlphp/simplesamlphp-module-metarefresh#dev-bugfix/http-client

  2. msalle commented on Mar 15, 2026

    @msalle
    ContributorAuthor

    Thanks for the quick response!

    Thanks @msalle ! Would you be able to run a test with the suggested fix in #63 ? You can install it by running bin/composer simplesamlphp/simplesamlphp-module-metarefresh#dev-bugfix/http-client

    With the #63 as patch I now get a new error:

    15:35:20.678Z metarefresh: Unsupported option "User-Agent" passed to "Symfony\Component\HttpClient\CurlHttpClient", did you mean "auth_basic", "auth_bearer", "query", "headers", "body", "json", "user_data", "max_redirects", "http_version", "base_uri", "buffer", "on_progress", "resolve", "proxy", "no_proxy", "timeout", "max_duration", "bindto", "verify_peer", "verify_host", "cafile", "capath", "local_cert", "local_pk", "passphrase", "ciphers", "peer_fingerprint", "capture_peer_cert_chain", "crypto_method", "extra", "auth_ntlm"?
    
  3. tvdijen commented on Mar 15, 2026

    @tvdijen
    Member

    Try again? I've pushed a one-liner fix

  4. msalle commented on Mar 15, 2026

    @msalle
    ContributorAuthor

    Try again? I've pushed a one-liner fix

    Now I get a stacktrace:

    0 /project/srv/www/site/simplesamlphp-2.5.0-prod/public/module.php:17 (N/A)
    SimpleSAML\Error\Error: UNHANDLEDEXCEPTION
    Backtrace:
    2 /project/srv/www/site/simplesamlphp-2.5.0-prod/src/SimpleSAML/Error/ExceptionHandler.php:47 (SimpleSAML\Error\ExceptionHandler::customExceptionHandler)
    1 /project/srv/www/site/simplesamlphp-2.5.0-prod/vendor/symfony/error-handler/ErrorHandler.php:538 (Symfony\Component\ErrorHandler\ErrorHandler::handleException)
    0 [builtin] (N/A)
    Caused by: TypeError: preg_match(): Argument #2 ($subject) must be of type string, null given
    Backtrace:
    8 /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaLoader.php:126 (preg_match)
    7 /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaLoader.php:126 (SimpleSAML\Module\metarefresh\MetaLoader::loadSource)
    6 /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaRefresh.php:129 (SimpleSAML\Module\metarefresh\MetaRefresh::runRefresh)
    5 /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/Controller/MetaRefresh.php:84 (SimpleSAML\Module\metarefresh\Controller\MetaRefresh::main)
    4 /project/srv/www/site/simplesamlphp-2.5.0-prod/vendor/symfony/http-kernel/HttpKernel.php:183 (Symfony\Component\HttpKernel\HttpKernel::handleRaw)
    3 /project/srv/www/site/simplesamlphp-2.5.0-prod/vendor/symfony/http-kernel/HttpKernel.php:76 (Symfony\Component\HttpKernel\HttpKernel::handle)
    2 /project/srv/www/site/simplesamlphp-2.5.0-prod/vendor/symfony/http-kernel/Kernel.php:193 (Symfony\Component\HttpKernel\Kernel::handle)
    1 /project/srv/www/site/simplesamlphp-2.5.0-prod/src/SimpleSAML/Module.php:240 (SimpleSAML\Module::process)
    0 /project/srv/www/site/simplesamlphp-2.5.0-prod/public/module.php:17 (N/A)
    Error report with id 38adb9a8 generated.
    

    I'm just verifying if that's due to a patch I have on MetaLoader.php... No it's not, it's https://github.com/simplesamlphp/simplesamlphp-module-metarefresh/blob/master/src/MetaLoader.php#L126

  5. msalle commented on Mar 15, 2026

    @msalle
    ContributorAuthor

    And more clearly from the commandline:

    ./bin/metarefresh.php -s https://metadata.surfconext.nl/edugain-downstream-idp.xml
    PHP Warning:  Undefined array key 0 in /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaLoader.php on line 126
    PHP Fatal error:  Uncaught TypeError: preg_match(): Argument #2 ($subject) must be of type string, null given in /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaLoader.php:126
    Stack trace:
    #0 /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaLoader.php(126): preg_match()
    #1 /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/bin/metarefresh.php(120): SimpleSAML\Module\metarefresh\MetaLoader->loadSource()
    #2 {main}
      thrown in /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaLoader.php on line 126
    

    The array has named indices of all the response headers, not 0 etc. (checked with a print_r).

  6. tvdijen commented on Mar 15, 2026

    @tvdijen
    Member

    We're getting there slowly. Can you give it another try with the updated PR?

  7. msalle commented on Mar 15, 2026

    @msalle
    ContributorAuthor

    We're getting there slowly. Can you give it another try with the updated PR?

    not yet there...:

    [root@ metarefresh]# ./bin/metarefresh.php -s http://metadata.surfconext.nl/edugain-downstream-idp.xml
    PHP Fatal error:  Uncaught Error: Call to a member function getStatusCode() on array in /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaLoader.php:126
    Stack trace:
    #0 /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/bin/metarefresh.php(120): SimpleSAML\Module\metarefresh\MetaLoader->loadSource()
    #1 {main}
      thrown in /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaLoader.php on line 126
    
  8. tvdijen commented on Mar 15, 2026

    @tvdijen
    Member

    I think I got it this time.

  9. msalle commented on Mar 15, 2026

    @msalle
    ContributorAuthor

    Yes! The metarefresh cronjob works fine now!

    I experimented also a little with the commandline tool, which still produces a stacktrace, but only after succesfully downloading:

    ./bin/metarefresh.php -s http://metadata.surfconext.nl/edugain-downstream-idp.xml > edugain.php
    PHP Warning:  Undefined array key "entityid" in /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaLoader.php on line 505
    PHP Fatal error:  Uncaught TypeError: addslashes(): Argument #1 ($string) must be of type string, null given in /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaLoader.php:509
    Stack trace:
    #0 /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaLoader.php(509): addslashes()
    #1 /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/bin/metarefresh.php(124): SimpleSAML\Module\metarefresh\MetaLoader->dumpMetadataStdOut()
    #2 {main}
      thrown in /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaLoader.php on line 509
    

    If I bork the URL and get a 404 it looks like I more or less get the right stacktrace:

    # ./bin/metarefresh.php -s http://metadata.surfconext.nl/edugain-downstream-idp.xm
    PHP Fatal error:  Uncaught Symfony\Component\HttpClient\Exception\ClientException: HTTP/2 404  returned for "https://metadata.surfconext.nl/edugain-downstream-idp.xm". in /project/srv/www/site/simplesamlphp-2.5.0-prod/vendor/symfony/http-client/Response/CommonResponseTrait.php:170
    Stack trace:
    #0 /project/srv/www/site/simplesamlphp-2.5.0-prod/vendor/symfony/http-client/Response/TransportResponseTrait.php(67): Symfony\Component\HttpClient\Response\CurlResponse->checkStatusCode()
    #1 /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaLoader.php(116): Symfony\Component\HttpClient\Response\CurlResponse->getHeaders()
    #2 /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/bin/metarefresh.php(120): SimpleSAML\Module\metarefresh\MetaLoader->loadSource()
    #3 {main}
      thrown in /project/srv/www/site/simplesamlphp-2.5.0-prod/vendor/symfony/http-client/Response/CommonResponseTrait.php on line 170
    

    although it probably should be caught?

    And likewise for illegal hostname:

    # ./bin/metarefresh.php -s http://metadata.surfconext.n/
    PHP Fatal error:  Uncaught Symfony\Component\HttpClient\Exception\TransportException: Could not resolve host: metadata.surfconext.n for "http://metadata.surfconext.n/". in /project/srv/www/site/simplesamlphp-2.5.0-prod/vendor/symfony/http-client/Response/CurlResponse.php:337
    Stack trace:
    #0 /project/srv/www/site/simplesamlphp-2.5.0-prod/vendor/symfony/http-client/Response/TransportResponseTrait.php(173): Symfony\Component\HttpClient\Response\CurlResponse::perform()
    #1 /project/srv/www/site/simplesamlphp-2.5.0-prod/vendor/symfony/http-client/Response/CommonResponseTrait.php(145): Symfony\Component\HttpClient\Response\CurlResponse::stream()
    #2 /project/srv/www/site/simplesamlphp-2.5.0-prod/vendor/symfony/http-client/Response/TransportResponseTrait.php(54): Symfony\Component\HttpClient\Response\CurlResponse::initialize()
    #3 /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaLoader.php(115): Symfony\Component\HttpClient\Response\CurlResponse->getStatusCode()
    #4 /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/bin/metarefresh.php(120): SimpleSAML\Module\metarefresh\MetaLoader->loadSource()
    #5 {main}
    
    Next Symfony\Component\HttpClient\Exception\TransportException: Could not resolve host: metadata.surfconext.n for "http://metadata.surfconext.n/". in /project/srv/www/site/simplesamlphp-2.5.0-prod/vendor/symfony/http-client/Chunk/ErrorChunk.php:55
    Stack trace:
    #0 /project/srv/www/site/simplesamlphp-2.5.0-prod/vendor/symfony/http-client/Response/CommonResponseTrait.php(146): Symfony\Component\HttpClient\Chunk\ErrorChunk->isFirst()
    #1 /project/srv/www/site/simplesamlphp-2.5.0-prod/vendor/symfony/http-client/Response/TransportResponseTrait.php(54): Symfony\Component\HttpClient\Response\CurlResponse::initialize()
    #2 /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaLoader.php(115): Symfony\Component\HttpClient\Response\CurlResponse->getStatusCode()
    #3 /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/bin/metarefresh.php(120): SimpleSAML\Module\metarefresh\MetaLoader->loadSource()
    #4 {main}
      thrown in /project/srv/www/site/simplesamlphp-2.5.0-prod/vendor/symfony/http-client/Chunk/ErrorChunk.php on line 55
    
  10. tvdijen commented on Mar 15, 2026

    @tvdijen
    Member

    It's hard for me to test, because I've never used this module and I think I need to set it up before I can use it like that. The command-line gives me no output at all..
    I think the exceptions from the HTTP-client should be caught now with my latest change.

    Can you debug the contents of the metadata-array at line 509 for me? It's very strange that the entityid is not there...

  11. madsi1m commented on Mar 15, 2026

    @madsi1m

    #63 seems to fix things for me.
    I had to also add this change #64 and now I can see a list of IDPs without errors/warnings.

  12. tvdijen commented on Mar 16, 2026

    @tvdijen
    Member

    Thanks @madsi1m ! But I'd much rather figure out where this difference is coming from. (and how this relates to the http-client update, because it seems unrelated).

  13. madsi1m commented on Mar 16, 2026

    @madsi1m

    With just #63 i get the list, with #64 it gets rid of the errors/warnings, it seems for some reason some IDPs are an array of single item [0] which then has everything inside which cause the issues, so i do a check.

    I can confirm i do not have this list problem on SSP 2.4.4 but do on 2.5.0

  14. 14 remaining items

  15. monkeyiq commented on Mar 17, 2026

    @monkeyiq
    Contributor

    I think #63 is ok. Looking for the metadata in the first element of a subarray in #64 seems a bit strange. I will have to try to replicate things to see why that is being put into a single entry sub-array in 2.5.x.

  16. monkeyiq commented on Mar 18, 2026

    @monkeyiq
    Contributor

    An update to #64 is at #66

    The scope of the issue seems to be only attributeauthority-remote for the test files I have been using.

  17. tvdijen commented on Mar 18, 2026

    @tvdijen
    Member

    @msalle Can you confirm or deny that the entities that have a strange array-format are ones that involve an AttributeAuthority ?

  18. msalle commented on Mar 18, 2026

    @msalle
    ContributorAuthor

    Hi @tvdijen

    @msalle Can you confirm or deny that the entities that have a strange array-format are ones that involve an AttributeAuthority ?

    I can confirm that:

  19. tvdijen commented on Mar 18, 2026

    @tvdijen
    Member

    @restena-sw the latest state is now in dev-bugfix/http-client. Would you be able to run a few tests?
    Also for the other people in this thread of course :)

  20. restena-sw commented on Mar 18, 2026

    @restena-sw

    Hmm... the error at hand has gone indeed. I still don't get metadata though, for a weird reason. When trying to execute metarefresh from admin UI, it returns with:

    Error adding trust anchors from file: /export/hosting/filesender-test/.curl.ca

    It's technically correct that this file does not exist. But it has never, and that was never a problem. I checked the prod instance with its 2.4.5 - that one doesn't have a .curl.ca either, but metarefresh works fine.

  21. restena-sw commented on Mar 18, 2026

    @restena-sw

    Ah, turns out we have a php.ini option set:
    php-fpm83.conf:php_value[curl.cainfo] = "/export/hosting/filesender-test/.curl.ca"

    My best guess is that old Symfony ignored this while the new one doesn't - but it's of course our fault for setting that incorrectly.

    And indeed, after removing that bogus line - our entities are fetched correctly.

    (The aggregate we use has no AttributeAuthorities)

  22. restena-sw commented on Mar 18, 2026

    @restena-sw

    This is the only line in Symfony source mentioning curl.cainfo: https://github.com/symfony/symfony/blame/ee4f425c6ce2eb164fe0a4a427a8d3d77c78b30b/src/Symfony/Component/HttpClient/HttpClient.php#L53

    But the git blame says it's unchanged since four years. It's a short-circuit OR - maybe SSP had previously set some other condition so that the pertinent one was never evaluated?

  23. tvdijen commented on Mar 18, 2026

    @tvdijen
    Member

    Metadata-files were downloaded using file_get_contents() before. The Symfony HTTP-client was introduced in SSP 2.5, so that's why your old install worked.

  24. tvdijen commented on Mar 18, 2026

    @tvdijen
    Member

    Tagged v1.3.1 of this module and I will make sure that ends up in the full-tarball in the next bugfix-release of SimpleSAMLphp

  25. msalle commented on Mar 18, 2026

    @msalle
    ContributorAuthor

    Tagged v1.3.1 of this module and I will make sure that ends up in the full-tarball in the next bugfix-release of SimpleSAMLphp

    Great, I presume you saw my last comment with the 3 points on AttributeAuthority? So I can assume the code with or without subarray is actually correct and you don't need further tests?

  26. tvdijen commented on Mar 18, 2026

    @tvdijen
    Member

    It's always good if you can verify things :) There shouldn't be any sub-arrays anymore now.

  27. msalle commented on Apr 26, 2026

    @msalle
    ContributorAuthor

    I finally managed to get back to this. Just tried the 1.3.1 release and all is well. Do you have plans to also release a new SSP tarball (soonish)?

  28. locked as resolved and limited conversation to collaborators on Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions