webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

MWS - Refused to connect to 'http://localhost:5555/' because it violates the following Content Security Policy directive: "connect-src 'self' https:"

  • 1.  MWS - Refused to connect to 'http://localhost:5555/' because it violates the following Content Security Policy directive: "connect-src 'self' https:"

    Posted Thu June 15, 2023 10:59 PM

    Product/components used and version/fix level: MWS 10.5

    Detailed explanation of the problem: We have done a new installation of MWS component in one of our environments, and we’re able to successfully sync with old one.

    Issue I’m facing now is, one of our custom Portlet which trying to establish the connection from MWS to ESB server we’re getting error on the console as “Refused to connect to ‘http://localhost:5555/’ because it violates the following Content Security Policy directive: “connect-src ‘self’ https:”.“

    And the same war file when we promote it to higher environments, its working as expected and users were able to perform their day today activity.

    Hence I’m unsure whether the issue is with the installation or Firewall related or do we need to explicitly configure any additional parameters to over come this error, because the Custom portlet is working as expected when we promote it to other environments.

    Error messages / full error message screenshot / log file:

    I got this error from Console when I inspect the browser screen,
    “Refused to connect to ‘http://localhost:5555/’ because it violates the following Content Security Policy directive: “connect-src ‘self’ https:”

    And nothing was printed in server logs or error logs.

    Question related to a free trial, or to a production (customer) instance? Customer Instance

    Please note that both MWS and ESB are installed on the same machine


    #Custom-Portlet
    #MWS-CAF-Task-Engine
    #MyWebMethods
    #BPM
    #webMethods
    #Portlet
    #Custom-War
    #Integration-Server-and-ESB
    #My-WebMethods


  • 2.  RE: MWS - Refused to connect to 'http://localhost:5555/' because it violates the following Content Security Policy directive: "connect-src 'self' https:"

    Posted Fri June 16, 2023 10:48 AM

    Can you share the related _full_.log entries here please? You can also try the steps below. I found it in empower, it looks similar to your problem. I hope it helps.

    1. Stop the MWS server if it is running.
    
    2. Go to the profile folder under installation directory (C:\SoftwareAG\profiles\MWS_default\configuration)
    
    3. Open the custom_wrapper.conf  file and add below entry in this file.
    
    # CSP (Content-Security-Policy) settings
    
    wrapper.java.additional.605=-Dcom.webmethods.content.security.disabled=true
    wrapper.java.additional.606=-Dcom.webmethods.content.security.hosts= <host_name>
    
    
    4. Start the MWS server and see the results.
    

    #My-WebMethods
    #webMethods
    #Custom-Portlet
    #MyWebMethods
    #Integration-Server-and-ESB
    #Custom-War
    #MWS-CAF-Task-Engine
    #Portlet
    #BPM


  • 3.  RE: MWS - Refused to connect to 'http://localhost:5555/' because it violates the following Content Security Policy directive: "connect-src 'self' https:"

    Posted Sun June 18, 2023 08:31 PM

    Hi @engin_arlak ,

    I did tried these steps, but this didn’t help… the issue remains the same.
    there is no error printed on the full.log file, it just printed as below,

    2023-06-19 10:29:46 AEST (c.w.p.f.i.PortalServlet:INFO) [qtp1766513480-198][ [RID:310]] [ [RID:310]] - Request [n5pief8mxue01acluyi9f9dkm:nambi.narayanan] http:/localhost:8585/appManager (GET)
    2023-06-19 10:29:46 AEST (jsf:INFO) [qtp1766513480-198][ [RID:310]] [ [RID:310]] - sessionTimeoutValue=1800


    #webMethods
    #Custom-War
    #Custom-Portlet
    #Portlet
    #MWS-CAF-Task-Engine
    #My-WebMethods
    #Integration-Server-and-ESB
    #BPM
    #MyWebMethods


  • 4.  RE: MWS - Refused to connect to 'http://localhost:5555/' because it violates the following Content Security Policy directive: "connect-src 'self' https:"

    Posted Mon June 19, 2023 10:52 AM

    Without the log files its impossible to detect the actual problem. All we can do is guess. For MWS if I ever experience any problems (which usually happens during fresh environment build, i.e. initial installation) I try to recreate OSGi profile first(especially if I have no clue). It usually fixes most of the problems. If that doesn’t work and if the environment is fresh I just reinstall it. Recreating the MWS instance is the same as fresh install.
    update OSGi profile

    If this doesn’t work and If you don’t have any important data/package deployed on MWS you can delete the instance and create it again.
    MWS Instance Administration

    Keep in mind that all these are just guesses and remember to back up any important data/configuration.

    How to execute commands to MWS


    #BPM
    #Custom-Portlet
    #My-WebMethods
    #MyWebMethods
    #Integration-Server-and-ESB
    #webMethods
    #MWS-CAF-Task-Engine
    #Portlet
    #Custom-War


  • 5.  RE: MWS - Refused to connect to 'http://localhost:5555/' because it violates the following Content Security Policy directive: "connect-src 'self' https:"

    Posted Tue June 20, 2023 12:04 AM

    Thanks @engin_arlak , I was able to resolve the issue…
    Had to include

    Under: Manage Response Header Rules
    Update: include connect-src ‘self’ ‘unsafe-eval’ ‘unsafe-inline’ http://localhost:*; font-src ‘self’ https:;

    and restart the MWS


    #My-WebMethods
    #BPM
    #MyWebMethods
    #Portlet
    #MWS-CAF-Task-Engine
    #Custom-Portlet
    #Integration-Server-and-ESB
    #Custom-War
    #webMethods