• Resolved gerroden

    (@gerroden)


    Hi,

    I really like the plugin and it fits all my needs.
    Now I have a hard time to get it working with some specific urls.
    Some examples:
    * https://www.mytischtennis.de/community/exportICSCalendar?teamids=2257204
    * https://www.mytischtennis.de/community/exportICSCalendar?teamids=2257204

    The browser will download an ICS file and even Google Calendar can import it by subscribing to the url.
    But with the plugin I get the message:

    Warning: ICS file could not be retrieved or was empty. ICS Calendar plugin requires cURL or allow_url_fopen. Please check your php.ini configuration. in […]/wp-content/plugins/ics-calendar/class-r34ics.php on line 256

    I tried some things out and never got it to work with curl but with wget from my shell easily.
    So maybe because curl needs more options, it also needs more in PHP.

    I would love to see a fix for this :).

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author room34

    (@room34)

    It’s possible that the URL you’re using is returning a 301 or 302 redirect. Browsers will handle this seamlessly and maybe wget does as well, but the plugin (and presumably cURL) won’t actually follow the redirect. I’ll look into this a bit more but if you can determine whether or not there’s a redirect, let me know. (I can test it later but I wanted to get you a quick response in case you’re actively working on this right now.)

    Thread Starter gerroden

    (@gerroden)

    It looks like this with wget:

    env LANG=en wget -dO – “https://www.mytischtennis.de/community/exportICSCalendar?teamids=2257207”

    Setting –output-document (outputdocument) to –
    DEBUG output created by Wget 1.19.1 on cygwin.

    Reading HSTS entries from /home/Gerro/.wget-hsts
    URI encoding = ‘ANSI_X3.4-1968’
    converted ‘https://www.mytischtennis.de/community/exportICSCalendar?teamids=2257207’ (ANSI_X3.4-1968) -> ‘https://www.mytischtennis.de/community/exportICSCalendar?teamids=2257207’ (UTF-8)
    –2020-02-15 20:40:38– https://www.mytischtennis.de/community/exportICSCalendar?teamids=2257207
    Certificates loaded: 149
    Resolving https://www.mytischtennis.de (www.mytischtennis.de)… 193.26.98.105
    Caching https://www.mytischtennis.de => 193.26.98.105
    Connecting to https://www.mytischtennis.de (www.mytischtennis.de)|193.26.98.105|:443… connected.
    Created socket 3.
    Releasing 0x00000006004d2e30 (new refcount 1).

    —request begin—
    GET /community/exportICSCalendar?teamids=2257207 HTTP/1.1
    User-Agent: Wget/1.19.1 (cygwin)
    Accept: */*
    Accept-Encoding: identity
    Host: https://www.mytischtennis.de
    Connection: Keep-Alive

    —request end—
    HTTP request sent, awaiting response…
    —response begin—
    HTTP/1.1 200 OK
    Set-Cookie: cfid=4387c644-65b3-454b-9d88-9e6946cd0b12;Path=/;Expires=Fri, 06-Mar-2020 21:18:48 UTC;HTTPOnly
    Set-Cookie: cftoken=0;Path=/;Expires=Fri, 06-Mar-2020 21:18:48 UTC;HTTPOnly
    Content-Disposition: inline; filename=mytischtennis_de_kalender_export_2020-02-15.ics
    Content-Type: text/calendar;charset=UTF-8
    Content-Length: 5100
    Date: Sat, 15 Feb 2020 19:40:43 GMT
    Server: Microsoft-IIS/7.5
    X-Varnish: 92256979
    Age: 0
    Via: 1.1 varnish-v4
    X-Cache: Miss
    Accept-Ranges: bytes
    Connection: close
    Set-Cookie: SRV=82; path=/

    —response end—
    200 OK

    Stored cookie https://www.mytischtennis.de -1 (ANY) / <session> <insecure> [expiry none] cfid 4387c644-65b3-454b-9d88-9e6946cd0b12

    Stored cookie https://www.mytischtennis.de -1 (ANY) / <session> <insecure> [expiry none] cftoken 0

    Stored cookie https://www.mytischtennis.de -1 (ANY) / <session> <insecure> [expiry none] SRV 82
    URI content encoding = ‘UTF-8’
    Length: 5100 (5.0K) [text/calendar]
    Saving to: ‘STDOUT’
    BEGIN:VCALENDAR
    METHOD:PUBLISH
    PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
    VERSION:2.0
    X-WR-CALNAME:Termine von TuS Et. Wiesbaden 1846
    BEGIN:VEVENT
    SUMMARY:TSG Niederhofheim 06 vs. TuS Et. Wiesbaden 1846
    DTSTART;TZID=Europe/Berlin:20190906T181500
    DTEND;TZID=Europe/Berlin:20190906T211500
    LOCATION:Schulturnhalle Wachenheimer Stra?e 67 65835 Liederbach
    DESCRIPTION:Vorrunde
    TRANSP:TRANSPARENT
    UID:6644FDBF4090B18B262B80F2AB45A0A5
    END:VEVENT
    […]
    END:VCALENDAR
    -end-

    0K …. 100% 171M=0s

    2020-02-15 20:40:38 (171 MB/s) – written to stdout [5100/5100]

    With curl i just never get the file. The response always just sends 200-OK, the header Content-Disposition and a session cookie. I already tried to find out, if the session cookies causes this, or if it is that header and just found out that wget handles both quietly.

    With curl:

    curl -IL “https://www.mytischtennis.de/community/exportICSCalendar?teamids=2257207&#8221;
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    0 0 0 0 0 0 0 0 –:–:– –:–:– –:–:– 0
    HTTP/1.1 200 OK
    Set-Cookie: cfid=f9c65d0f-be83-4e0a-892a-a953318ce3b2;Path=/;Expires=Fri, 06-Mar-2020 21:30:02 UTC;HTTPOnly
    Set-Cookie: cftoken=0;Path=/;Expires=Fri, 06-Mar-2020 21:30:02 UTC;HTTPOnly
    Content-Disposition: inline; filename=mytischtennis_de_kalender_export_2020-02-15.ics
    Content-Type: text/calendar;charset=UTF-8
    Date: Sat, 15 Feb 2020 19:51:58 GMT
    Server: Microsoft-IIS/7.5
    X-Varnish: 150420197
    Age: 0
    Via: 1.1 varnish-v4
    X-Cache: Miss
    Accept-Ranges: bytes
    Connection: close
    Set-Cookie: SRV=81; path=/

    I have a similar Problem, tried to curl it from the server and got the file, no issue there but from inside the plugin i hear:

    
    SSL operation failed with code 1. OpenSSL Error messages:
    error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed in /.../wp-content/plugins/ics-calendar/functions.php on line 390

    then it sais failed to enable crypto and failed to open stream

    not sure if this is related but i get this from google calendar as well as several nextcloud calendars

    Plugin Author room34

    (@room34)

    If you’re able to SSH into your web server and successfully retrieve the feed using cURL, then the issue is most likely something in your PHP configuration. First I would make sure to update everything on the web server, if possible, including (especially) PHP, cURL and OpenSSL. Then you may need to check your PHP configuration.

    One other thing —?be sure that the SSL certificate on your feed server has not expired; it’s possible that you were running cURL with flags to bypass peer verification.

    Beyond that you may just need to search on that OpenSSL error and see if you find anything helpful, such as this:

    https://stackoverflow.com/questions/46511717/how-to-fix-ssl-certificate-verification-failure

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘ICS file could not be retrieved’ is closed to new replies.