[OE-core] [PATCH] send-error-report: Use https instead of http protocol

Robert Yang liezhi.yang at windriver.com
Mon Mar 4 07:50:23 UTC 2019


Hi Khem,

We have an internal error web server, this patch breaks it:

You're accessing the development server over HTTPS, but it only supports HTTP

So I tried to use runsslserver, but it doesn't work either since the host is
Ubuntu 14.04 (python 2.7.6):

$ python manage.py runsslserver

[snip]
     ssl_version=ssl.PROTOCOL_TLSv1_2,
AttributeError: 'module' object has no attribute 'PROTOCOL_TLSv1_2'

This is because python is old.

I think that make it default to https would make the server harder to set up,
so is it possible to:

* Make it default to http, and add an option such as --https (or --ssl) for https

Or:

* Add an option such as --no-ssl to make it use http.

I prefer the first one since https server is harder to setup than http in 
django. I can work on it if no objections.

// Robert

On 2/5/19 2:13 AM, Khem Raj wrote:
> errors.yp.org can understand https
> 
> Signed-off-by: Khem Raj <raj.khem at gmail.com>
> ---
>   scripts/send-error-report | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/scripts/send-error-report b/scripts/send-error-report
> index 8939f5f594..3528cf93a9 100755
> --- a/scripts/send-error-report
> +++ b/scripts/send-error-report
> @@ -62,7 +62,7 @@ def edit_content(json_file_path):
>   
>   def prepare_data(args):
>       # attempt to get the max_log_size from the server's settings
> -    max_log_size = getPayloadLimit("http://"+args.server+"/ClientPost/JSON")
> +    max_log_size = getPayloadLimit("https://"+args.server+"/ClientPost/JSON")
>   
>       if not os.path.isfile(args.error_file):
>           log.error("No data file found.")
> @@ -132,9 +132,9 @@ def send_data(data, args):
>       headers={'Content-type': 'application/json', 'User-Agent': "send-error-report/"+version}
>   
>       if args.json:
> -        url = "http://"+args.server+"/ClientPost/JSON/"
> +        url = "https://"+args.server+"/ClientPost/JSON/"
>       else:
> -        url = "http://"+args.server+"/ClientPost/"
> +        url = "https://"+args.server+"/ClientPost/"
>   
>       req = urllib.request.Request(url, data=data, headers=headers)
>       try:
> 


More information about the Openembedded-core mailing list