SSL between Angular and REST

658 views
Skip to first unread message

Glenn G

unread,
Dec 23, 2021, 12:32:49 PM12/23/21
to DSpace Technical Support
Following the DSpace 7.1 installation guide here, https://wiki.lyrasis.org/display/DSDOC7x/Installing+DSpace, I am unable to proceed past step 4.a.  When I run "yarn config:check:rest", it produces this error message:

ERROR connecting to REST API
Error: write EPROTO 140676344637312:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:

My environment.prod.ts:

export const environment = {
  ui: {
      ssl: false,
      host: 'localhost',
      port: 4000,
      nameSpace: '/'
  },
  rest: {
      ssl: true,
      host: 'test.ourschool.edu',
      port: 8080,
      nameSpace: '/server',
  },
};

If I change the "rest: ssl:" to false, the yarn check passes, but then I am unable to log in via the user interface.  It looks like an SSL problem, but I don't understand where the REST server or the Angular front end are supposed to find their SSL certificates.  Is it the Java keystore, or the operating system certificate store, or somewhere else?  Do both the front end and the back end use the same certificate store, or does it depend on which user each runs under?

My operating system is Ubuntu 20.04 LTS, using Tomcat 9.

Thanks for any assistance.

Glenn

Glenn G

unread,
Dec 23, 2021, 5:01:05 PM12/23/21
to DSpace Technical Support
It seems that since my setup uses Apache as a proxy, Apache does the SSL work between the front end and back end.  Other web servers I manage are happy enough to have only the server certificate and the root certificate designated in the Apache configuration.  For DSpace 7.1, I found that the chain certificate was also needed.  Once that was in place, "yarn config:check:rest" gave a more promising response, and I was able to configure environment.prod.ts as shown below.  After re-running "yarn run build:prod", the server works, and I am able to log in.

environment.prod.ts

export const environment = {
  ui: {
      ssl: false,
      host: 'localhost',
      port: 4000,
      nameSpace: '/'
  },
  rest: {
      ssl: true,
      host: 'test.ourschool.edu',
      port: 443,
      nameSpace: '/server',
  },
};
Reply all
Reply to author
Forward
0 new messages