Author Topic: BassEnc.BASS_Encode_ServerInit method use with BASS_ENCODE_SERVER_SSL  (Read 605 times)

kafffee

  • Posts: 293
Hi everybody :-)

I want to use BassEnc.BASS_Encode_ServerInit method with BASS_ENCODE_SERVER_SSL.

However, when I try to start streaming, I get error code BASS_ERROR_SERVER_CERT (2101)   - missing/invalid certificate

I added BASS_SSL library to m yprogram folder, is there anything els that I need to do and missed out?

Ian @ un4seen

  • Administrator
  • Posts: 26212
Yes, you need to provide a certificate and private key for the server to use, like you would for a normal web server. If you would just like to quickly try things, test files are included with the SERVER.C example in the BASSenc package (C\SERVER folder), which are used like this:

Code: [Select]
// example SSL certificate for HTTPS
BASS_SetConfigPtr(BASS_CONFIG_ENCODE_SERVER_CERT, "testcert.crt");
BASS_SetConfigPtr(BASS_CONFIG_ENCODE_SERVER_KEY, "testcert.key");

kafffee

  • Posts: 293
Ah okay so basically, if my program user wants to stream over a HTTPS address, I need to provide the option for him to pick such certificate files and the rest is up to him?
And if not, the stream is sent unencrypted?
How will I know in the end whether a http or https connection is established?
« Last Edit: 28 May '24 - 01:19 by kafffee »

Ian @ un4seen

  • Administrator
  • Posts: 26212
Yes, if the software is being used by others then it's probably best to let them provide their own certificate. An unencrypted server can still be used without a certificate but you will need to remove the BASS_ENCODE_SERVER_SSL flag from the BASS_Encode_ServerInit call for that (to stop the call failing).

There isn't currently any way to check whether a client has an encrypted or unencrypted connection when a server supports both (ie. when using BASS_ENCODE_SERVER_SSL rather than BASS_ENCODE_SERVER_SSLONLY).

kafffee

  • Posts: 293
Okay thanks, that was the information that I needed. :-)