[CSHARP-2459] Do not output port in ToString() for '+srv' urls Created: 20/Dec/18  Updated: 28/Oct/23  Resolved: 31/Jan/19

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 2.8.0

Type: Bug Priority: Minor - P4
Reporter: Ethan [X] Assignee: Robert Stam
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by CSHARP-2524 MongoUrlBuilder creates wrong url. Closed
Backwards Compatibility: Fully Compatible

 Description   

Reproduction steps:

1) Create a MongoUrl or use the MongoUrlBuilder

2) take that url and get the string version of it with ToString() or any way of getting the raw connection string

Actual: outputs a port in the connection string

Expected: no port should exist in the connection string

 

This mainly causes issues when parsing the connection string because there is validation to prevent ports when +srv is specified

 



 Comments   
Comment by Githook User [ 31/Jan/19 ]

Author:

{'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}

Message: CSHARP-2459: Handle ssl option correctly also when mongodb+srv is used.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/c82584e82a5ad419a937b1d2305b861dfb8dbf10

Comment by Githook User [ 31/Jan/19 ]

Author:

{'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}

Message: CSHARP-2459: Fix whitespace in MongoUrlBuilderTests.cs.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/0f292c2d6e4497b52f77cf2aa320f91b1193c74f

Comment by Githook User [ 31/Jan/19 ]

Author:

{'name': 'Ethan Celletti', 'email': 'ECelletti@SciSolutions.com'}

Message: CSHARP-2459: Adding unit test
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/d9d587effa7312127604bb40770a4acda33d468b

Comment by Githook User [ 31/Jan/19 ]

Author:

{'name': 'Ethan Celletti', 'email': 'Gekctek@Gmail.com', 'username': 'Gekctek'}

Message: CSHARP-2459: Not outputting port to '+srv' urls

Having an issue with turning a mongourl to as string then re-parsing it. There is validation on parsing that the port cant be defined with '+srv' but the ToString() outputs the port
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/75a0e6bcb3313a3431fc2f39d9eda38431560f48

Comment by Ethan [X] [ 20/Dec/18 ]

 Github PR

https://github.com/mongodb/mongo-csharp-driver/pull/362

Generated at Wed Feb 07 21:42:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.