Remote Certificate Is Invalid According To The Validation Procedure GMAIL
Oct 19, 2010
The function below works in a console application but it's not working in my asp.net web site. I am getting an error:The remote certificate is invalid according to the validation procedure.
public static void SendEmail(MailMessage mm)
{
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.Port = 587;
smtp.EnableSsl = true;
smtp.Credentials = new NetworkCredential("ma@mail.com", "Pass");
when sending email the' asp.net 2.0 i get the above error msg The remote certificate is invalid according to the validation procedure. how to rectify this error msg soemetmes i get this error msg also Mailbox unavailable. The server response was:: bosauthsmtp15: Host :No unauthenticated relaying permitted
i have created a mail application as a part of an support application for my company.when enabling ssl it is showing the error as "The remote certificate is invalid according to the validation procedure"when commenting enablessl its working fine and mails are going. i know that the problem is with ssl autentication. i have made no changes to web.config file.
MailMessage msg = new MailMessage(); string[] a = mailto.Text.Split(','); oreach (string str in a) [code]...
Upon looking up other pages and threads related to this error, they are about HttpExchange, Exchange Web Services etc which is why this has threw me off as I'm sure mine may be related to the setup of mailSettings in the Web.Config - Although, I could be way off :)Although I have setup mailSettings successfully for Gmail accounts for testing purposes, I've been given specific credentials for which to set up to go live, which once there entered and I test locally, I recieve this error message
I am looking to get the data from any given domain names SSL certificate. For example I want to put in any website address e.g. "www.asp.net" and my code would firstly check if an SSL certificate exists. If it does then I want it to pull out the Issuer, Subject, Valid From and Valid Until etc. The intention is to create an SSL certificate checker similar to this: [URL]
How can I do this ASP.net???? - I have looked up loads of different things such as RequestCertificateValidationCallback and ClientCertificates etc.
would I create a HTTPWebRequest and then somehow request the client certificate and specific elements that way?
I tried to add a stored procedure to my already group of procedures. For example, I have link_delete, Link_insert, Link_update I need a way to insert a link and this must relax the constraints: I tried to create a Link_insert2 and the thing is underlined in red saying Invalid Object in my query window. I basically renamed the existing Link_Insert stored procedure and added the line:
ALTER TABLE tblLink DROP FOREIGN KEY FK_tblLinks_tblWebSite
because my program is not able to write to the table unless I do this. I was going to just forget the stored procedure altogether and use a sub which I did and is writing a row. It is not returning the SCOPE_IDENTITY however, and I must get that. Can someone tell me how to get that?
Let's assume our users in their office using Internet explorer to sign some Web Pages using their client certificate imported into the Internet explorer browser (let s assume no other browser is used)
what is a good approach/architecture for validating the client certificate (Internet Explorer), how to send that certificate or the signed form to the server and how do we verify the signature
Should we use smart client approach integrated to the web application or some silverlight or so or is web form/web pages enough to implement this security requirement ?
I have a SQL stored procedure on a SQL server that uses a variable to create a new database. This works in SQL I have a connection string that works I have added a sqldatasource to a webform, and configured the datasource to connect to the remote SQL database and am able to select my stored procedure. I am able to bind the variable to a control in the sqldatasource wizard (often two of the same control appear- if that is significant)
When I test the sqldatasource in the configuration wizard and put in a manual entry, the procedure runs and works
It is on the web page I am having troubles. I want the user to enter a name in a text box, click a button/link, and run the procedure. Ive used buttons and links...but not in the right way I think, becuase when I click them the stored procedure doesnt run.
As mentioned above, I have selected the right control in the sqldatasource wizard. So what do I need to do now?
The reCaptcha example for ASP.NET does not seem to work. I followed the instructions but it always returns false, "The verification words are incorrect.". The entries are good. I'm using localhost as the site but am not getting any public/private key errors which I did get when adding a bad key (as a test).I've seen this error reported a lot but no good answers. Some suggest to call the validate on the control before checking to see if it is valid but this did not work for me.
The problem is that when I submit a blank form back to the controller, I get redirected to the "its valid" page, meaning that the form passed validation.
I'm creating a simple login functionality on my own.
I have a 'Users' Model class, that contains UserID, Username and Password and I want to put some validating attributes to my properties. I put [Remote] attribute to validate whether the username is duplicated.
[Code]....
And 'ValidateUserName' is checking for duplication like this:
[Code]....
I have 2 strongly-typed view that are using the Users Model. The first one is for User Registration which is working fine, i.e. not allowing duplicated user names.
But the second one I use for User Login and when the user writes his name a validation error is thrown that says that the Username is taken (which is correct). But I want the Remote validation to fires only when Creating new user. Do you know how to do this?
I'm still trying to deploy this site, but with every problem I solve, another arises. Anyways - I've set up the database at my hosting to allow remote connections, and it is running Sql Server 2005. On my development machine, I am working with Sql Server 2008.
I've installed the asp.net schema on my hosted database, and have created several users from the ASP.NET web administration interface, as well as tested that the login works. Running the application locally with the remote connection string nets the same results. However - I'm able to run my scripts and generate my tables and stored procedures without errors - but when the site is run I get the following error on all of my .aspx pages that try to access a stored procedure:
Server Error in '/' Application. Incorrect syntax near 'LoadProfileData'. Description: An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near 'LoadProfileData'.
Source Error:
Line 62: adapter.SelectCommand.Parameters.Add("@ProfessionalName", SqlDbType.VarChar).Value = professionalName; Line 63: DataSet profile = new DataSet(); Line 64: adapter.Fill(profile, "Profile"); Line 65: return profile; Line 66: }
Is this a possible Sql 2005 vs 2008 issue? I'm hoping someone else has seen this issue in a similar scenario and can point me in the right direction. The server is running asp.net 2.0, 3.0 and 3.5 and IIS 7.0.
Stored Procedure:
Drop procedure CreateDefaultProfile GO Create procedure CreateDefaultProfile(@UserName varchar(256)) as declare @ProfessionalID uniqueidentifier
I'd like to disable ModelState validation messages and keep my data annotation error messages.
When I update model, message "The value '' is invalid." apears in ModelState. I know that I'm trying to assign null to not nullable property, but I have my own validation and message.
I use something like this
[Required(ErrorMessage="Blahblah some error")]
I want user to see my message "Blahblah some error", but not stupid message: The value '' is invalid.
The date range validates perfectly during model binding. However, . Looking at the client validation code in MicrosoftMvcValidation.js, it appears that the Sys_Mvc_RangeValidator can only handle numeric ranges
I have been trying to use the [Remote] attribute to perform remote validation in MVC3, but the namespace/type cannot be found. I thought it was in the System.ComponentModel.DataAnnotations assembly, but I have checked in the Object Browser and I can't find it.
I'm still trying to deploy this site, but with every problem I solve, another arises. Anyways - I've set up the database at my hosting to allow remote connections, and it is running Sql Server 2005. On my development machine, I am working with Sql Server 2008.
I've installed the asp.net schema on my hosted database, and have created several users from the ASP.NET web administration interface, as well as tested that the login works. Running the application locally with the remote connection string nets the same results. However - I'm able to run my scripts and generate my tables and stored procedures without errors - but when the site is run I get the following error on all of my .aspx pages that try to access a stored procedure:
Server Error in '/' Application. Incorrect syntax near 'LoadProfileData'. Description: An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near 'LoadProfileData'.
Source Error:
Line 62: adapter.SelectCommand.Parameters.Add("@ProfessionalName", SqlDbType.VarChar).Value = professionalName; Line 63: DataSet profile = new DataSet(); Line 64: adapter.Fill(profile, "Profile"); Line 65: return profile; Line 66: }
Is this a possible Sql 2005 vs 2008 issue? I'm hoping someone else has seen this issue in a similar scenario and can point me in the right direction. The server is running asp.net 2.0, 3.0 and 3.5 and IIS 7.0.
I've run across with client-side validation. Firstly I'm assuming that everything is set up properly because client validation is working fine other than this specific scenario. The scenario is that if I have a field with a validation attribute on it then I can clear th field value and client validation won't flag it as an error even though the validation should fail. If, however, I type in something that is invalid then from then on it works correctly. It seems like client validation is missing the clearing of the field if it has not yet generated a validation error. Here's a simple model to demo the issue:
[Code]....
Now assume that I have this as my model instance: new SimpleModel() { Id = 1, Name = "One1", EventTime = DateTime.Now } The model is valid. Now I drop in an edit form generated by the Add View dialog. Again I'm assuming client validation is properly set up because it works except for the very specific scenario given earlier.........................
I have a TabContainer, within a tab, i have a gridview, within the gridview i have a ImageButton. When I click on the ImageButton, I will call a javascript. The javascript will call a Hidden Button click. This hiddenbutton is the TargetControl of the Modalpopup so that when I click on the ImageButton, modalpopup is trigger. The Popup panal, Hidden Button and ModalPopupExtender below:
I have a form where users enter their preferred contact method. It has:
- a radio button where a user selects whether they'd like to be contact by phone or email or either
- a textbox for the user's email address
- a textbox for the user's phone number
I have validation via a custom attribute that verifies that if the user selected phone they entered a phone number, if they selected email they entered an email, etc... but it's at a class level on my ViewModel. As such the validation doesn't mark the expected field as invalid.
Is there a way that my IsValid override (or some other method) can mark the child property's value as invalid so I get highlighting?
I've got my validation wired up through my Service layer, and my Birthdate property looks like this.
[Code]....
The client side validation works properly if I input something like `12/12/1990` but when the form is submitted, the server side validation trips and I'm told the entry is invalid. I'm using the jQuery-UI Datepicker to input the date, however when I disable the datepicker, the problem persists.Am I missing something here? I thought the client side and server side would be the same thing.If I remove
[Code]....
Then the form submits. It's obviously something to do with the Regex.
I have used a pattern of compound view models for a few of the forms in this project. It works very well.
In this case I have a VendorAddress view model. I use Address(es) in a few places in this project so I made and Address view model object that I can re-use. Then I desided I want to do a very thorough checking of the state codes and zips so, I desided I would try to use remote validation and check the state and zip code aganst a stored set of tables in the database.
The problem is I am not getting values back to the remote action methods for the fields I'm asking for (in this case State and PostalCode). I believe this is because of the name mangleing that the MVC framework does for compound or sub types for id(s) for the inputs in this case it is making names like 'Address_Line1' and 'Address_State' and 'Address_PostalCode'.
Ultimately the question I have is, is there a way of turning off the pre-pended 'Address_' from the base view model object in a way that MVC framework can put it bak into the object after ther post of the form?
[Code]....
Then in the form after rendering it looks like this:
[Code]....
I get the remote call but there is nothing in the parameters "State" and "PostalCode", so the unobtrusive routines are firing but I think it does not know where to look for the data even though I have type something in the mensioned fields. As you can see in the rendered code the id="Address_State" and the data-val-remote-additionalfields="*.State,*.PostalCode"