Steps to Create a Secure Link

Steps to Create a Secure Link

Introduction

VergeCloud allows you to generate secure links for files that are protected from unauthorized access. The process involves creating a hash based on the visitor's IP, file path, expiry timestamp, and a secret key. This document will guide you through the steps to create a secure link and use it effectively.

Step 1: Create a New Page-Rule

First, you will need to create a new page-rule. This rule can also be configured for wildcard URLs if you want to apply it to multiple paths or files.

 

Screenshot

A screenshot of a computer

AI-generated content may be incorrect.

 

Step 2: Generate a New Hash for the Visitor

To generate a secure link, you'll need to create a hash that includes the visitor's IP address, the file path, an expiry timestamp, and a secret key. This hash is used to verify the authenticity of the link request.

 

Information Required

Visitor's IP Address

File Path

Expiry Timestamp

Secret Key

 

Example:

Visitor IP Address: 14.143.179.162

Path: /Logos-38.png

Expire timestamp: 1865746809

Key: 123456

 

Command to Get Visitor IP:


You can use the following command to get the visitor's IP address (using curl):

 

curl ifconfig.io -4

 

Example output:


14.143.179.162 

 

Screenshot

A screenshot of a computer screen

AI-generated content may be incorrect.

 

Command to Generate the Hash:

To create the hash, use the md5sum command with the visitor's IP address, file path, expiry timestamp, and key concatenated together. Here's how you can do it:

 

echo -n "14.143.179.162 /Logos-38.png 1865746809 123456" | md5sum

 

Example output:

5e87dfa7cf51e8bd2212d0a15cfeac37  -

 

  

Step 3: Access the Secure Link

Now that you have the generated hash, you can create the secure URL to access the file. The format for the secure URL is as follows:

 

https://files.vergecloud.cloud/{path}?hash={generated_hash}&expires={expiry_timestamp}

 

Using the example above, the URL will look like this:

 

https://files.vergecloud.cloud/Logos-38.png?hash=5e87dfa7cf51e8bd2212d0a15cfeac37&expires=1865746809

 

Step 4: Testing the Secure Link

To test the link, you can use the curl command:

 

Without the hash:

curl https://files.vergecloud.cloud/Logos-38.png -D - -o /dev/null

 

You should receive an HTTP 403 Forbidden response, indicating the link is not accessible without the correct hash.

 

Response Headers

HTTP/2 403

date: Mon, 24 Mar 2025 08:54:03 GMT

content-type: text/html

content-length: 3083

vary: Accept-Encoding

content-security-policy: upgrade-insecure-requests

server: vergecloud

server-timing: total;dur=3

x-served-by: 7500

 

Screenshot

A screenshot of a computer

AI-generated content may be incorrect.

 

With the hash:

curl"https://files.vergecloud.cloud/Logos-38.png?hash=58c373dfdac9d9751fd37e32e74a8fe7&expires=1743417364" -D - -o /dev/null

 

You should receive a successful HTTP 200 response and the file will be accessible.

 

 

Response Headers

HTTP/2 200

date: Mon, 24 Mar 2025 08:54:28 GMT

content-type: image/png

content-length: 14759

last-modified: Mon, 24 Mar 2025 08:49:13 GMT

x-rgw-object-type: Normal

etag: "654df29e14dd9ce1058a34c617bcba3f"

x-amz-request-id: tx00000f7200ea656c73f40-0067e11dc4-b0489ea-blr1a

vary: Origin, Access-Control-Request-Headers, Access-Control-Request-Method

strict-transport-security: max-age=15552000; includeSubDomains; preload

x-xss-protection: 1; mode=block

server: vergecloud

server-timing: total;dur=12

x-cache-status: BYPASS

x-served-by: 7500

accept-ranges: bytes

 

Screenshot

A screen shot of a computer

AI-generated content may be incorrect.

 

Troubleshooting

 

Common Issues

  • 403 Forbidden Error: This typically means that the hash or expiration timestamp is incorrect. Double-check that the generated hash matches the required parameters.

  • Expired Link: If the expiration timestamp has passed, the link will no longer work. Ensure that the expiration time is valid and hasn’t expired.

 

Conclusion

By following these steps, you can generate secure links for your files in Verge Cloud, ensuring they are accessible only to authorized visitors based on the hash you’ve created. Always test the link to verify that it is functioning correctly before sharing it.
    • Related Articles

    • Steps to Activate Cloud Icon for VergeCloud

      Checks Before Activating Cloud Icon For Domain Once you've transferred your website to VergeCloud and updated your DNS settings, there are a few steps to complete before activating the Cloud icon for the records in the VergeCloud user panel. These ...
    • Steps to Build an SSL Certificate Trust Chain

      Why SSL Certificate Trust Chain Is Important? To ensure your website operates smoothly with HTTPS across all browsers and devices, it's essential to implement an SSL Certificate Trust Chain instead of using just one certificate. What You Need ...
    • Essential Steps Before Changing Nameservers to VergeCloud

      Considerations Verify A Records and Their IP Addresses: After registering your domain in the VergeCloud User Panel, the first action is to confirm that the A records have been transferred correctly and that the associated IP address is accurate. ...
    • Page Rules

      VergeCloud Page Rules Page Rules allow you to customize and optimize your domain’s behavior within VergeCloud’s CDN. By leveraging Page Rules, you can enhance performance, security, and resource management for specific URLs, creating a tailored ...
    • Custom SSL Certificate

      Custom SSL Certificate You can continue utilizing your custom SSL certificate by navigating to the VergeCloud HTTPS Settings. Introduction Custom SSL certificates are essential for securing data transmitted over the internet. With VergeCloud, users ...