[SOLVED] cannot get content from url

Ask for help or provide support to other members.
Post Reply
hominid
Posts: 6
Joined: Sat Mar 25, 2023 11:02 pm

[SOLVED] cannot get content from url

Post by hominid »

I just discovered this cms and it seems lovely, but I'm having some trouble.
I installed on localhost. I enabled https and added a vhost entry, so I can access my installation at https://wonder.test

However, every time I log in, an error pops up saying "cannot get content from url"
Also, when I navigate to Settings > Plugins or Settings > Themes, there are no entries. There is just a text field to enter the url to a wcms-modules.json file.

I tried entering :

Code: Select all

 https://raw.githubusercontent.com/pawell0/summernote-editor-lite/master/wcms-modules.json
into the text field, but two more errors popped up: "The wcms-modules.json file does not contain all the required information." and "Invalid URL. The module URL needs to contain the full path to the raw wcms-modules.json file." -- along with the usual "cannot get content from url".

The contents of the json file are:

Code: Select all

{
    "version": 1,
    "plugins": {
        "summernote-editor-lite": {
            "name": "Summernote Editor Lite",
            "repo": "https://github.com/pawell0/summernote-editor-lite/tree/master",
            "zip": "https://github.com/pawell0/summernote-editor-lite/archive/master.zip",
            "summary": "Adds an WYSIWYG editor to all content editable fields. This is the Summernote Lite editor.",
            "version": "1.0.5",
            "image": "https://raw.githubusercontent.com/pawell0/summernote-editor-lite/master/preview.jpg"
        }
    }
}
My specs:
Windows 11
Apache 2.4.54.2
PHP: 8.0.26

Any help or suggestions would be much appreciated.
Last edited by hominid on Sun Mar 26, 2023 5:59 pm, edited 1 time in total.
hominid
Posts: 6
Joined: Sat Mar 25, 2023 11:02 pm

Re: cannot get content from url

Post by hominid »

OK More info:
I'm using WampServer v3.3.0
I upgraded to php 8.2.0

The debug info is:

Code: Select all

*   Trying 185.199.109.133:443...
* Connected to raw.githubusercontent.com (185.199.109.133) port 443 (#0)
* ALPN: offers h2
* ALPN: offers http/1.1
* SSL certificate problem: unable to get local issuer certificate
* Closing connection 0
I also tried downloading a SSLCACertificateFile from https://curl.se/docs/caextract.html and added it to my ssl VirtualHost entry but got the same result.

My VirtualHost entry is:
-------------------------------------------------

Code: Select all

<VirtualHost _default_:443>
DocumentRoot "c:/wamp64/www/wonder"
ServerName wonder.test:443
ServerAdmin admin@example.com
ErrorLog "${SRVROOT}/logs/error.log"
TransferLog "${SRVROOT}/logs/access.log"

SSLEngine on
SSLCACertificateFile "${SRVROOT}/certs/cacert.pem"
SSLCertificateFile "${SRVROOT}/certs/certificate.crt"
SSLCertificateKeyFile "${SRVROOT}/certs/private.key"

<FilesMatch "\.(cgi|shtml|phtml|php)$">
    SSLOptions +StdEnvVars
</FilesMatch>
<Directory "${SRVROOT}/cgi-bin">
    SSLOptions +StdEnvVars
</Directory>

CustomLog "${SRVROOT}/logs/ssl_request.log" \
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

</VirtualHost>
-------------------------------------------------

When I generated a self-signed cert/key pair, I used "localhost" for the common name. This is super convenient because I use the same cert/key pair for all my local projects (https://project1.test, https://project2.test, etc) but could this be the problem?

Do I have to generate a certificate specifically for wonder.test in order for curl to work?

This might be a question for Stack Overflow....
hominid
Posts: 6
Joined: Sat Mar 25, 2023 11:02 pm

Re: cannot get content from url

Post by hominid »

I also copied the pem file I downloaded from https://curl.se/docs/caextract.html to my php folder and added these two lines to php.ini

openssl.cafile="C:\wamp64\bin\php\php8.2.0\extras\ssl\cacert.pem"
openssl.capath="C:\wamp64\bin\php\php8.2.0\extras\ssl\cacert.pem"

Still not working...
hominid
Posts: 6
Joined: Sat Mar 25, 2023 11:02 pm

Re: cannot get content from url

Post by hominid »

SOLVED !!
This answer on stack overflow solved my problem :)
https://stackoverflow.com/a/48488736/1739597
Post Reply