# HOOPS Communicator server with HTTPS (SSL)

**URL:** <https://forum.techsoft3d.com/t/hoops-communicator-server-with-https-ssl/1681>\
**Category:** HOOPS Visualize Web\
**Tags:** knowledge-base, faq, how-to\
**Created:** [March 7, 2023, 3:20am UTC](https://forum.techsoft3d.com/t/hoops-communicator-server-with-https-ssl/1681 "2023-03-07T03:20:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Toshi-TS3D](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.techsoft3d.com/toshi-ts3d/32/885_2.png) [@Toshi-TS3D](https://forum.techsoft3d.com/u/Toshi-TS3D)\
**Post date:** [March 7, 2023, 3:20am UTC](https://forum.techsoft3d.com/t/hoops-communicator-server-with-https-ssl/1681/1 "2023-03-07T03:20:26Z")

</div>

## Introduction

This article is step-by-step guide to create HOOPS Communicator SC server with HTTPS (SSL) server.  
If you haven’t created HTTPS server, please refer this article: [How to setup HTTPS server with AWS](https://forum.techsoft3d.com/t/how-to-setup-https-server-with-aws/1680)

## Instruction

### HOOPS Communicator server installation

Place the folders and files required for the HC server from the SDK.  
Here is an illustration of how to configure the server:

```auto
+ var
  + www
    + html
      + src
    + server
    + 3rd_party
    + sc_models

```

1. Transfer the `tar.gz` file of HOOPS Communicator for Linux to the `/tmp` folder of the virtual server via SCP

2. Extract the `tar.gz` file

```auto
cd /tmp
tar -zxvf HOOPS_Communicator_202x_SPx_Linux.tar.gz

```

1. Allocate the necessary folders in a root folder of nginx

```auto
cd HOOPS_Communicator_202x_SPx/
sudo cp -r 3rd_party/ server/ /var/www/
sudo cp -r quick_start/converted_models/standard/sc_models/ /var/www/
sudo cp -r web_viewer/src /var/www/html/

```

### HOOPS Communicator server setup

1. Open `Config.js` for HOOPS Communicator Stream Cache Server

```auto
sudo vi /var/www/server/node/Config.js

```

1. Set SSL settings

```auto
...
    publicHostname: "YOUR_DOMAIN_NAME",
...
    sslCertificateFile: "/etc/letsencrypt/live/YOUR_DOMAIN_NAME/fullchain.pem",
...
    sslPrivateKeyFile: "/etc/letsencrypt/live/YOUR_DOMAIN_NAME/privkey.pem",
...
    sslEnableFileServer: false,
...
    sslEnableSpawnServer: true,
...
    sslEnableScServer: false,

```

Note that set `false` to `sslEnableScServer` if you use Proxy Connection of SC server.

1. Set model search directory

```auto
    modelDirs: [
        "./sc_models",
    ],

```

1. Save and quit:`:wq`

### Start the HOOPS Communicator server

1. Edit the inbound rules of the virtual server to open port 11182  

2. Start the HOOPS Communicator server

```auto
sudo sh /var/www/server/node/start_server.sh

```

 ![SSL_16](https://us1.discourse-cdn.com/flex020/uploads/techsoft3d/original/1X/f7b6d989e4ce4b96666c1c0a22fec1b9b917b25d.png)

1. Open `https://YOUR_DOMAIN_NAME/src/hoops_web_viewer_sample.html?wsPort=11182&instance=microengine`  
Error message will appear  
 ![SSL_17](https://us1.discourse-cdn.com/flex020/uploads/techsoft3d/original/1X/55f33ffd47643ec5f4fe67edc7a8c33ca358dbf1.png)  
  
 ![SSL_18](https://us1.discourse-cdn.com/flex020/uploads/techsoft3d/original/1X/10574bd01f76151a9e3098e835653c4bd9dd5288.png)

### Error fixing

1. Stop the HOOPS Communicator Server by pressing the `Enter` key on the SSH
2. Show log file list of the server

```auto
ls -al ~/ts3d_communicator_logs/ 

```

1. Verify the latest log file

```auto
cat ~/ts3d_communicator_logs/comm_scserver_csr_2023_02_...

```

 ![SSL_19](https://us1.discourse-cdn.com/flex020/uploads/techsoft3d/original/1X/e91887106b1726ef379943f412aa7303f6f9df3c.png)

1. Since the Cart expects to find your certificate in `/etc/pki/tls/certs/ca-bundle.crt`, it is stored in `/etc/ssl/certs/ca-certificates.crt`  
You can fix this error by adding a symlink to the expected path

```auto
mkdir -p /etc/pki/tls/certs
ln -s /etc/ssl/certs/ca-certificates.crt /etc/pki/tls/certs/ca-bundle.crt

```

1. Start the HOOPS Communicator server and reload the page  
3D model appears using SSL  
 ![SSL_20](https://us1.discourse-cdn.com/flex020/uploads/techsoft3d/original/1X/aef910f1c44b5a83c806226562d0d83ddf7addf4.png)

---

<div class="post-metadata">

**Author:** ![1435389123](https://avatars.discourse-cdn.com/v4/letter/1/ebca7d/32.png) [@1435389123](https://forum.techsoft3d.com/u/1435389123)\
**Post date:** [August 18, 2023, 3:52am UTC](https://forum.techsoft3d.com/t/hoops-communicator-server-with-https-ssl/1681/2 "2023-08-18T03:52:14Z")

</div>

I use the HC 2023 for testing https server. Here is the error, how to fixed it. Thanks a lot!

“2023-8-18 11:48:33 AM:error: file-server: proxy-error: Error [ERR\_TLS\_CERT\_ALTNAME\_INVALID]: Hostname/IP does not match certificate’s altnames: IP: 127.0.0.1 is not in the cert’s list:”

I have installed the CA use the “certmgr.msc”.

**server\_config\_127\_0\_0\_1.js**

```auto
publicHostname: "127.0.0.1",

sslCertificateFile: "./quick_start/cert.crt",

sslPrivateKeyFile: "./quick_start/cert.key",

// Determines if SSL is enabled for the file-server.
sslEnableFileServer: true,

// Determines if SSL is enabled for the spawn-server.
sslEnableSpawnServer: true,

// Determines if SSL is enabled for the spawned stream-cache servers.
sslEnableScServer: true,

```

**start\_server.bat**

```auto
:: Script is relative to this directory 
@cd "%~dp0"

@set node_install_dir=%~dp0\..\3rd_party\node
@set NODE_EXTRA_CA_CERTS=%~dp0\cert.crt

:: Must start the server from the node dir 
@cd ../server/node

:: Perform the node command directly here to pass in the quick-start config and not the server/node config 
@call "%node_install_dir%\node.exe" --expose-gc ./lib/Startup.js --config-file ../../quick_start/server_config_127_0_0_1.js

```

---

<div class="post-metadata">

**Author:** ![Toshi-TS3D](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.techsoft3d.com/toshi-ts3d/32/885_2.png) [@Toshi-TS3D](https://forum.techsoft3d.com/u/Toshi-TS3D)\
**Post date:** [August 18, 2023, 5:02am UTC](https://forum.techsoft3d.com/t/hoops-communicator-server-with-https-ssl/1681/3 "2023-08-18T05:02:24Z")

</div>

Hi,

This article is written using a public DNS.  
As you can see in this article: [How to setup HTTPS server with AWS](https://forum.techsoft3d.com/t/how-to-setup-https-server-with-aws/1680)  
certificate file is needed to be created using a valid DNS.

In fact, you error message says:  
“Hostname/IP does not match certificate’s altnames: IP: 127.0.0.1 is not in the cert’s list:”,  
your certificate file seems to be not compatible with localhost (127.0.0.1).

Could you try to configure a HTTPS environment using a public DNS?

This article seems to be for localhost environment, [How-To : Using HOOPS Communicator with SSL](https://forum.techsoft3d.com/t/how-to-using-hoops-communicator-with-ssl/1339)

Best regards,  
Toshi
