URLConnection error 1200 ?

  1. 5 weeks ago

    Jean-Yves P

    Jul 14 Pre-Release Testers, Xojo Pro Europe (France, Besançon)
    Edited 5 weeks ago

    "an ssl error happened and it's impossible to make a secure connection with the server"

    where does this error comes from, and how do I workaround it ?

    just trying to get a file using it's url. pasting this url in a web broswer gives me the file.

    Thanks.

    so I've found my last error : "malformed web url"
    it because of accentuated chars in the url like é or à
    the EncodeURLComponent does not help here, it makes too much of conversion...
    you must replace like this :

    anUrl = anUrl.ReplaceAllB( " ", "%20")
    anUrl = anUrl.ReplaceAllB( "è", "%C3%A8")
    anUrl = anUrl.ReplaceAllB( "é", "%C3%A9")
    anUrl = anUrl.ReplaceAllB( "ê", "%C3%AA")
    anUrl = anUrl.ReplaceAllB( "à", "%C3%A0")
    ...

    and the 1200 error you must add some info.plist to the (mac) app like described here.
    http://docs.xojo.com/UserGuide:App_Transport_Security

  2. Beatrix W

    Jul 14 Pre-Release Testers Europe (Germany)

    Getting a file using it's url is surprisingly not easy. How does your code look like? Which socket to you use? Platform? You may need to adjust the SSL type for your socket.

  3. Wayne G

    Jul 15 Pre-Release Testers, Xojo Pro New Zealand axisdirect.nz

    You could try setting AllowCertificateValidation to false & see if that works. If it does that would point the issue at the provider.

  4. Jean-Yves P

    Jul 15 Pre-Release Testers, Xojo Pro Europe (France, Besançon)

    @Wayne G You could try setting AllowCertificateValidation to false & see if that works. If it does that would point the issue at the provider.

    same problem

  5. Jean-Yves P

    Jul 15 Pre-Release Testers, Xojo Pro Europe (France, Besançon)

    @Beatrix W Getting a file using it's url is surprisingly not easy. How does your code look like? Which socket to you use? Platform? You may need to adjust the SSL type for your socket.

    you can't adjust the ssl type with urlconnection ? only with old http sockets ?

  6. Beatrix W

    Jul 15 Pre-Release Testers Europe (Germany)

    I have a similar file that couldn't be downloaded: https://valentina-db.com/components/com_easydiscuss/themes/wireframe/images/emails/logo.png

    I had to add some special file for validating the certificate. But I'm using Curl because the newer socket had non-reproducible crashes.

  7. Greg O

    Jul 15 Xojo Inc

    @Jean-YvesPochez "an ssl error happened and it's impossible to make a secure connection with the server"

    where does this error comes from, and how do I workaround it ?

    just trying to get a file using it's url. pasting this url in a web broswer gives me the file.

    Thanks.

    The error is from the OS as URLConnection uses native sockets (as opposed to the older sockets that were written entirely in Xojo code).

    My immediate thought is that since a browser works, the server probably requires a user-agent header.

    Otherwise, you might try the url as http instead. I don’t think I’ve ever seen a server downgrade a connection like that, but it’s probably not impossible.

  8. Jean-Yves P

    Jul 15 Pre-Release Testers, Xojo Pro Europe (France, Besançon)

    I already tried with http instead of https, it does not work
    I will try to set a user agent.

  9. Jean-Yves P

    Jul 15 Pre-Release Testers, Xojo Pro Europe (France, Besançon)
    Edited 5 weeks ago

    sorry, it does not work with a user agent as a requestHeader.
    I also have an error of "malformed url" if there is any space in the url, even if I replace them with %20
    (and of course the same url pasted in a web browser gives the file with %20 or with a space...)

    I try to get the urls:
    https://www.caf.fr/sites/default/files/styles/image_slider/public/cnaf/Vies%20de%20famille/RUB - Elever ses enfants/Accès aux loisirs/Partir_enlivre_2019_3.jpg
    and
    https://www.caf.fr/ruxitagentjs_ICA2SVfghjqrtux_10167190521165248.js

  10. Tim P

    Jul 15 Pre-Release Testers Rochester, NY

    The error is coming from the system, so you should keep digging. Google suggests it's a certificate error

  11. Jean-Yves P

    Jul 15 Pre-Release Testers, Xojo Pro Europe (France, Besançon)

    this could be related to the special plist arguments you have to provide to the app, as seen in https://docs.xojo.com/UserGuide:App_Transport_Security

    is there an example of such plist file ? can I simply make it and drop it into a root xojo project ?

  12. Jean-Yves P

    Jul 15 Pre-Release Testers, Xojo Pro Europe (France, Besançon)

    I make a info.plist file with the app security keys, but xojo stores it in the ressources folder, and don't mix it with the app info.plist ...
    what is the way to go ?

  13. Jean-Yves P

    Jul 15 Pre-Release Testers, Xojo Pro Europe (France, Besançon)

    can you use a modified info.plist on a debug app, or is it only on the compiled app ?

  14. Wayne G

    Jul 15 Pre-Release Testers, Xojo Pro New Zealand axisdirect.nz

    This appears to be a Mac thing. I'm not having a problem on Windows.

  15. Tim P

    Jul 15 Pre-Release Testers Rochester, NY

    @Wayne G This appears to be a Mac thing. I'm not having a problem on Windows.

    @Greg OLone The error is from the OS as URLConnection uses native sockets (as opposed to the older sockets that were written entirely in Xojo code).

    You are correct, Wayne. The newer sockets (Xojo.Net.HTTPSocket and URLConnection) use system level APIs, so the error codes are now specific to the platform.

  16. Hal G

    Jul 15 Pre-Release Testers, Xojo Pro, XDC Speakers CampSoftware.com
    Edited 5 weeks ago

    @Tim P The newer sockets (Xojo.Net.HTTPSocket and URLConnection) use system level APIs, so the error codes are now specific to the platform.

    Oh no. One of the main reasons I like Xojo is how it abstracts target differences.

  17. Geoff P

    Jul 15 Xojo Inc Austin, Texas

    The URLConnection.Error event only fires when the connection just couldn't be made at all. The description that we had in the docs was wrong so I have just updated it. I suspect in most cases that's all that really matters.

    However, we could be mapping the most common errors to our own special set of URLConnection errors. Perhaps an enum?

    So I have created a case in Feedback for this. Please feel free to sign on to it, add your own thoughts, etc.

    While I can't make any promises about when we will do this, given that URLConnection is relatively new and is part of API 2.0, I can say that I'd like to see this get done sooner rather than later.

  18. Karen A

    Jul 15 Pre-Release Testers
    Edited 5 weeks ago

    @Hal G Oh no. One of the main reasons I like Xojo is how it abstracts target differences.

    It also means there can be be more OS specific quirks as well as X-platform performance differences... which could mean we would need to code differently by platform to get the best performance, more so than now...

    Not sure using system APIs is always the best thing for a product like Xojo outside of UI stuff... I think these types of things fall into another category. I guess that understandably they are looking to be able to maintain/update less code.

    Time will tell how well that works out overall for Xplatform work on our end.

    - karen

  19. Norman P

    Jul 15 Pre-Release Testers, Xojo Pro great-white-software.com/blog
    Edited 5 weeks ago

    The upside to using platform native API's is thet you then get whatever improvements fixes etc the platform makes

    And you dont have to try & work around some platform silliness like https://developer.apple.com/library/archive/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/CommonPitfalls/CommonPitfalls.html

    Plus you get native handling of things like proxies etc exactly as the OS vendor intended

  20. Hal G

    Jul 16 Pre-Release Testers, Xojo Pro, XDC Speakers CampSoftware.com

    @Norman P The upside to using platform native API's

    That's cool as long as we don't need separate error testing per target.

    Imagine not having SpecialFolder where you have to use a Case statement to test which target you are on to simply specify a path...

  21. Newer ›

or Sign Up to reply!