Add proper x509 certificate generation

This commit is contained in:
Konstantin Itskov
2018-08-25 02:29:32 -04:00
committed by Sean DuBois
parent b7a21badc9
commit c6bc9ab4e7
6 changed files with 270 additions and 77 deletions

View File

@@ -27,23 +27,23 @@ func (s RTCIceServer) validate() error {
if url.Type == ice.ServerTypeTURN {
// https://www.w3.org/TR/webrtc/#set-the-configuration (step #11.3.2)
if s.Username == "" || s.Credential == nil {
return &InvalidAccessError{Err: ErrNoTurnCred}
return &InvalidAccessError{Err: ErrNoTurnCredencials}
}
switch s.CredentialType {
case RTCIceCredentialTypePassword:
// https://www.w3.org/TR/webrtc/#set-the-configuration (step #11.3.3)
if _, ok := s.Credential.(string); !ok {
return &InvalidAccessError{Err: ErrTurnCred}
return &InvalidAccessError{Err: ErrTurnCredencials}
}
case RTCIceCredentialTypeOauth:
// https://www.w3.org/TR/webrtc/#set-the-configuration (step #11.3.4)
if _, ok := s.Credential.(RTCOAuthCredential); !ok {
return &InvalidAccessError{Err: ErrTurnCred}
return &InvalidAccessError{Err: ErrTurnCredencials}
}
default:
return &InvalidAccessError{Err: ErrTurnCred}
return &InvalidAccessError{Err: ErrTurnCredencials}
}
}
}