File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
webrtc/src/peer_connection Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ impl RTCCertificate {
131
131
let mut bytes = [ 0u8 ; 8 ] ;
132
132
bytes. copy_from_slice ( & expires_pem. contents [ ..8 ] ) ;
133
133
let expires = if let Some ( e) = SystemTime :: UNIX_EPOCH
134
- . checked_add ( Duration :: from_nanos ( u64:: from_le_bytes ( bytes) ) . into ( ) )
134
+ . checked_add ( Duration :: from_secs ( u64:: from_le_bytes ( bytes) ) . into ( ) )
135
135
{
136
136
e
137
137
} else {
@@ -162,13 +162,15 @@ impl RTCCertificate {
162
162
#[ cfg( feature = "pem" ) ]
163
163
pub fn serialize_pem ( & self ) -> String {
164
164
// Encode `expires` as a PEM block.
165
+ //
166
+ // TODO: serialize as nanos when https://github.com/rust-lang/rust/issues/103332 is fixed.
165
167
let expires_pem = pem:: Pem {
166
168
tag : "EXPIRES" . to_string ( ) ,
167
169
contents : self
168
170
. expires
169
171
. duration_since ( SystemTime :: UNIX_EPOCH )
170
172
. expect ( "expires to be valid" )
171
- . as_nanos ( )
173
+ . as_secs ( )
172
174
. to_le_bytes ( )
173
175
. to_vec ( ) ,
174
176
} ;
You can’t perform that action at this time.
0 commit comments