Results 1 to 4 of 4

Thread: How to disable ssl validation in swiftmailer settings?

  1. #1
    New user
    Join Date
    10-15-18.
    Posts
    8

    Default How to disable ssl validation in swiftmailer settings?

    I have problem while trying to configure smtp using ssl (Contao 4.4):

    this works:
    parameters.yml
    Code:
    swiftmailer:
       ...
        ...
        port: 587
        encryption: null
    but this does not work:
    parameters.yml
    Code:
    swiftmailer:
       ...
        ...
        port: 465
        encryption: ssl
    Code:
    app.CRITICAL: An exception occurred. {"exception":"[object] (Swift_TransportException(code: 0): Connection could not be established with host *********** [ #0] at /srv/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:277)"} []
    I tried to put this into pararameters.yml
    Code:
    swiftmailer:
       ...
        ...
        port: 465
        encryption: ssl
        stream_options:
            ssl:
                verify_peer: false
                verify_peer_name: false
    But this gives contao manager error:
    Code:
    Loading composer repositories with package information
    Installing dependencies from lock file
    Nothing to install or update
    Generating optimized autoload files
    contao/manager-plugin: Generating plugin class...
    contao/manager-plugin: ...done generating plugin class
    > Contao\ManagerBundle\Composer\ScriptHandler::initializeApplication
    
    In ArrayNode.php line 375:
                                                  
      merge() expects a normalized config array.  
                                                  
    
    Script Contao\ManagerBundle\Composer\ScriptHandler::initializeApplication handling the post-install-cmd event terminated with an exception
    
    In ScriptHandler.php line 113:
                                                                                
      An error occurred while executing the "contao:install-web-dir" command:   
      In ArrayNode.php line 375:                                                
                                                                                
        merge() expects a normalized config array.                              
                                                                                
    
    install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...
    
    
    # Process terminated with exit code 1
    # Result: General error
    
    
    ---
    
    ### The background task has stopped unexpectedly ###

  2. #2
    User Spooky's Avatar
    Join Date
    01-03-13.
    Posts
    339

    Default

    You should never disable the SSL verification, this is a very, very bad idea.

  3. #3
    New user
    Join Date
    10-15-18.
    Posts
    8

    Default

    Unverified ssl is better than open text :D

    Problem fixed - I got a new hostname with a valid certificate from the mail server admin

  4. #4
    User Spooky's Avatar
    Join Date
    01-03-13.
    Posts
    339

    Default

    Quote Originally Posted by noemail View Post
    Unverified ssl is better than open text :D
    Maybe, but the correct solution is to get SSL working . Which you did anyway

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •