int _reNegotiateAfterSeconds = 3600; //1hr #endregion #region constructor public InternalBitChatService(BitChatService service, BitChatProfile profile, Certificate[] trustedRootCertificates, SecureChannelCryptoOptionFlags supportedCryptoOptions) { _service = service; _profile = profile; _trustedRootCertificates = trustedRootCertificates; _supportedCryptoOptions = supportedCryptoOptions; _connectionManager = new ConnectionManager(_profile.LocalEP, ChannelRequest); LocalPeerDiscovery.StartListener(41733); _localDiscovery = new LocalPeerDiscovery(_connectionManager.LocalEP.Port); _localDiscovery.PeerDiscovered += _localDiscovery_PeerDiscovered; _profile.LocalEP = _connectionManager.LocalEP; }
public frmSettings(BitChatService service) { InitializeComponent(); _service = service; BitChatProfile profile = service.Profile; txtPort.Text = profile.LocalEP.Port.ToString(); txtDownloadFolder.Text = profile.DownloadFolder; chkUseCRL.Checked = profile.CheckCertificateRevocationList; foreach (Uri tracker in profile.TrackerURIs) { txtTrackers.Text += tracker.AbsoluteUri + "\r\n"; } _timer = new Timer(); _timer.Interval = 1000; _timer.Tick += _timer_Tick; _timer.Start(); }
public InternalBitChatService(BitChatService service, BitChatProfile profile, Certificate[] trustedRootCertificates, SecureChannelCryptoOptionFlags supportedCryptoOptions) { _service = service; _profile = profile; _trustedRootCertificates = trustedRootCertificates; _supportedCryptoOptions = supportedCryptoOptions; _connectionManager = new ConnectionManager(_profile.LocalEP, ChannelRequest); LocalPeerDiscovery.StartListener(41733); _localDiscovery = new LocalPeerDiscovery(_connectionManager.LocalEP.Port); _localDiscovery.PeerDiscovered += _localDiscovery_PeerDiscovered; _profile.LocalEP = _connectionManager.LocalEP; }
public frmMain(BitChatProfile profile, string profileFilePath, string cmdLine) { InitializeComponent(); _profile = profile; _profileFilePath = profileFilePath; SecureChannelCryptoOptionFlags cryptoOptions; switch (Environment.OSVersion.Platform) { case PlatformID.Win32NT: if (Environment.OSVersion.Version.Major > 5) cryptoOptions = SecureChannelCryptoOptionFlags.ECDHE256_RSA_WITH_AES256_CBC_HMAC_SHA256 | SecureChannelCryptoOptionFlags.DHE2048_RSA_WITH_AES256_CBC_HMAC_SHA256; else cryptoOptions = SecureChannelCryptoOptionFlags.DHE2048_RSA_WITH_AES256_CBC_HMAC_SHA256; break; default: cryptoOptions = SecureChannelCryptoOptionFlags.DHE2048_RSA_WITH_AES256_CBC_HMAC_SHA256; break; } //start bitchat service _service = new BitChatService(profile, Program.TRUSTED_CERTIFICATES, cryptoOptions, InvalidCertificateEvent); }
private void InvalidCertificateEvent(BitChatService sender, InvalidCertificateException e) { MessageBox.Show(e.Message, "Invalid Certificate Detected", MessageBoxButtons.OK, MessageBoxIcon.Error); this.Hide(); this.DialogResult = System.Windows.Forms.DialogResult.Ignore; this.Close(); }
private void InvalidCertificateEvent(BitChatService sender, InvalidCertificateException e) { MessageBox.Show(e.Message + "/r/n/r/nClick OK to logout from this Bit Chat profile.", "Invalid Certificate Detected", MessageBoxButtons.OK, MessageBoxIcon.Error); notifyIcon1.Visible = false; this.Hide(); this.DialogResult = System.Windows.Forms.DialogResult.Ignore; this.Close(); }