-1

I'm working with the certificates of the courses, but the students are not being able to download the certificates. The certificate download button is shown on the dashboard, however the link looks like

http://localhost:18090/downloads/e3a9bbf9353743e994df6863467cfcca/Certificate.pdf

Obviously, I can't download the certificate, even changing the address to my server's one, I cannot make it to work.

Where can I modify it in order to enable the download of the certificates?

PS.: if I navigate to the path /edx/var/certs/www-data/downloads/e3a9bbf9353743e994df6863467cfcca/Certificate.pdf I can see that the certificate for this student was generated correctly.

Thanks!

3 Answers3

1

By default there is no authentication for the certificate download URL. In the more recent versions of open-edx there is a default nginx configuration that should work:

server {
  listen 18090 default_server;

  location / {
    root /edx/var/certs/www-data;
         satisfy any;

     allow 127.0.0.1;
     deny all;

     auth_basic            "Restricted";
     auth_basic_user_file  /edx/app/nginx/nginx.htpasswd;

     index index.html
     proxy_set_header X-Forwarded-Proto https;
    try_files $uri $uri/valid.html =404;
  }
}

Check to ensure that you have this nginx configuration file in /edx/app/nginx/sites-enabled and that you don't have any firewall rules in place that would prevent you from connecting on that port.

jarv
  • 5,338
  • 24
  • 26
1

The reason your download URL contains http://localhost:18090 is because it is the default value defined for the certificate generation process defined here.

Where can I modify it in order to enable the download of the certificates?

You will want to redefine and override the value CERT_DOWNLOAD_URL to match your needs either in your server-vars.yml file in /edx/app/edx_ansible/ or in your env.json file in /edx/app/certs/ depending on how you have defined your build process.

If you change server-vars.yml, you will need to run the following to compile/generate the resources (including env.json) and restart the certs process:

sudo /edx/bin/update read-only-certificate-code <your-release e.g. named-release/birch> 

If you change env.json, you will need to run the following to restart the certs process:

sudo -u www-data /edx/bin/supervisorctl -c /edx/app/supervisor/supervisord.conf restart certs

There are other variables that will need to be set as well in addition to CERT_DOWNLOAD_URL to customize your environment such as CERT_VERIFY_URL.

Another good resource related to this on the Open edX general discussion board is here. It describes using S3 as a repository for Certificates and affects what values you would use for CERT_DOWNLOAD_URL.

stuart
  • 136
  • 2
  • 5
0

You are downloading from your own machine? http://localhost:18090 is port 18090 on your own computer. (I think you noticed that).

Now, the actual link on edX is pointing to a server, and that server is then pointing to a verification server (you can see that when the cursor is over the 'Download' button). Surely, edX won't let you download the certificate immediately - you will have to follow the authentication protocol in your program, if you want to do it programmatically.

On the other hand, you marked only the 'edx' tag, which doesn't give us an indication as to what you are really wanting to do.

jcoppens
  • 5,306
  • 6
  • 27
  • 47