mirror of
https://github.com/pion/webrtc.git
synced 2025-10-30 02:12:03 +08:00
Add proper x509 certificate generation
This commit is contained in:
committed by
Sean DuBois
parent
b7a21badc9
commit
c6bc9ab4e7
@@ -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}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user