If you want to upload this image as avatar https://jenkins.erwan-projects.fr/static/00f9e71c/images/headshot.png it failed:
The file specified could not be found.
Because in remote_upload() function, the host parameter of fsockopen is never appended with 'tls://' and port is always 80, if avatar is a https ressource; so remote upload works only if resource is also accessible by http://
Even if there is, on web hosting, a redirect from http to https; it failes again:
because response looks like this:
The upload was rejected because the uploaded file was identified as a possible attack vector
I suggest to detect if url is a https resource, and append the host parameter with 'tls://' (and change port) if needed.
I think with let's encrypt, more and more websites will be accessible by HTTPS, this bug can be annoying.