[GH-ISSUE #178] Configuration file error: failed to read #146

Open
opened 2026-02-26 12:34:07 +03:00 by kerem · 7 comments
Owner

Originally created by @SavvyEngineer on GitHub (Nov 23, 2021).
Original GitHub issue: https://github.com/cbeuw/Cloak/issues/178

Hi thanks for this amazing project i cloned the repo and build but when i try to use the ck-server -c config file i get

Configuration file error: Failed to read configuration file: illegal base64 data at input byte 0

I even tried the exact example config file but still the same

and im using Centos

Originally created by @SavvyEngineer on GitHub (Nov 23, 2021). Original GitHub issue: https://github.com/cbeuw/Cloak/issues/178 Hi thanks for this amazing project i cloned the repo and build but when i try to use the ck-server -c config file i get ``` Configuration file error: Failed to read configuration file: illegal base64 data at input byte 0 ``` I even tried the exact example config file but still the same and im using Centos
Author
Owner

@anuradhapriyankara commented on GitHub (Feb 17, 2022):

@SavvyEngineer I'm facing the same issue on Ubuntu 20.04 Server. Have you found a solution for this?

<!-- gh-comment-id:1043138704 --> @anuradhapriyankara commented on GitHub (Feb 17, 2022): @SavvyEngineer I'm facing the same issue on Ubuntu 20.04 Server. Have you found a solution for this?
Author
Owner

@anuradhapriyankara commented on GitHub (Feb 18, 2022):

I have tested V2.0.0 and it worked as expected on Ubuntu 20.04. However none of the newer versions did. I'll be using V2.0.0 until devs fix the issue.

<!-- gh-comment-id:1044928750 --> @anuradhapriyankara commented on GitHub (Feb 18, 2022): I have tested V2.0.0 and it worked as expected on Ubuntu 20.04. However none of the newer versions did. I'll be using V2.0.0 until devs fix the issue.
Author
Owner

@cbeuw commented on GitHub (Feb 18, 2022):

The sample config is not meant to work (I suspected that people are using default UIDs and keys so I pulled it). If you look at its content you'll see placeholders asking you to provide your own UID and keys.
github.com/cbeuw/Cloak@847b7e24bf/example_config/ckserver.json (L20-L25)

You need to generate public key, private key and a UID following the steps in README https://github.com/cbeuw/Cloak#server-1:

You don't need to have the AdminUID field if you don't intend to add more than one users, just delete it from the JSON file, and put your UID in BypassUID (and in client config ofc)

<!-- gh-comment-id:1044947294 --> @cbeuw commented on GitHub (Feb 18, 2022): The sample config is not meant to work (I suspected that people are using default UIDs and keys so I pulled it). If you look at its content you'll see placeholders asking you to provide your own UID and keys. https://github.com/cbeuw/Cloak/blob/847b7e24bf406b284dd7f008af26c205f81271d2/example_config/ckserver.json#L20-L25 You need to generate public key, private key and a UID following the steps in README https://github.com/cbeuw/Cloak#server-1: You don't need to have the AdminUID field if you don't intend to add more than one users, just delete it from the JSON file, and put your UID in BypassUID (and in client config ofc)
Author
Owner

@anuradhapriyankara commented on GitHub (Feb 20, 2022):

@cbeuw Actually I have generated my own private key, public key and Admin UID and replaced them in json configuration file yet the error still occurs. It seems to be occurring while unmarshalling the json configuration file into golang block. Here is a similar case on stackoverflow

Unfortunately I'm not a go lang developer so couldn't fix the issue myself. This might be something only happens on Linux. However, as I have already mentioned V2.0.0 doesn't have this issue and it works as expected on Ubuntu 20.04 server.

<!-- gh-comment-id:1046262592 --> @anuradhapriyankara commented on GitHub (Feb 20, 2022): @cbeuw Actually I have generated my own private key, public key and Admin UID and replaced them in json configuration file yet the error still occurs. It seems to be occurring while unmarshalling the json configuration file into golang block. Here is a similar case on [stackoverflow](https://stackoverflow.com/questions/65872616/go-illegal-base64-data-at-input-byte-0-when-unmarshalling-a-string-json ) Unfortunately I'm not a go lang developer so couldn't fix the issue myself. This might be something only happens on Linux. However, as I have already mentioned V2.0.0 doesn't have this issue and it works as expected on Ubuntu 20.04 server.
Author
Owner

@cbeuw commented on GitHub (Feb 20, 2022):

@anuradhapriyankara The Stackoverflow question has the data in hex format (like 000daf177434acd55a3284787b793a3453c3d70eacdb9a84f5faed43adb2ff58), instead of Base64 format (like T4mu9oB7D9GOzXwUoFD/UNps3JfJW2dv7RlhpiqmImc=). Which format is yours in? Cloak currently only accepts UIDs and keys in Base64. This is also what ck-server -key and ck-server -uid displays

<!-- gh-comment-id:1046266516 --> @cbeuw commented on GitHub (Feb 20, 2022): @anuradhapriyankara The Stackoverflow question has the data in hex format (like `000daf177434acd55a3284787b793a3453c3d70eacdb9a84f5faed43adb2ff58`), instead of Base64 format (like `T4mu9oB7D9GOzXwUoFD/UNps3JfJW2dv7RlhpiqmImc=`). Which format is yours in? Cloak currently only accepts UIDs and keys in Base64. This is also what `ck-server -key` and `ck-server -uid` displays
Author
Owner

@anuradhapriyankara commented on GitHub (Feb 20, 2022):

@cbeuw Just checked again and realized I have left BypassUID as "-" instead of just "". My bad. Latest version works well. I have used an older configuration template with V2.0.0 so that's why it worked. Sorry for the confusion.

Great project and keep up the good work! This has been really useful for me to bypass speed limits imposed upon certain applications by my ISP.

<!-- gh-comment-id:1046272884 --> @anuradhapriyankara commented on GitHub (Feb 20, 2022): @cbeuw Just checked again and realized I have left BypassUID as "-" instead of just "". My bad. Latest version works well. I have used an older configuration template with V2.0.0 so that's why it worked. Sorry for the confusion. Great project and keep up the good work! This has been really useful for me to bypass speed limits imposed upon certain applications by my ISP.
Author
Owner

@cbeuw commented on GitHub (Feb 20, 2022):

@anuradhapriyankara Thank you, glad to hear!

<!-- gh-comment-id:1046282358 --> @cbeuw commented on GitHub (Feb 20, 2022): @anuradhapriyankara Thank you, glad to hear!
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Cloak#146
No description provided.