adithyan's avatar

Validation Failure Results in "Error: Client network socket disconnected before secure TLS connection was established" Instead of Error Messages

I'm encountering an issue with Laravel Request class, upon failure, instead of receiving the expected validation error messages, I'm getting the following error: "Error: Client network socket disconnected before secure TLS connection was established". I've set up a custom form request (GalleryImageCreateRequest) with validation rules for my image upload functionality. The validation logic seems to work fine when the validation is success. However, when it comes to displaying the error messages, I'm encountering this unexpected behavior.

class GalleryImageCreateRequest extends FormRequest
{
    public function authorize()
    {
        return true;
    }

    public function rules()
    {
        return [
            'image' => 'required|file',
            'title' => 'required|string',
            'description' => 'required|string',
        ];
    }
}
0 likes
6 replies
Tray2's avatar

That sounds like a server issue rather than a code issue. HAve you tried restarting your server?

adithyan's avatar

@Tray2 yeah tried restarting! There's no issue if the validation is success but when it fails, shows the above message

adithyan's avatar

@Tray2 local server is working fine , if i add failedValidation() request class it shows validation errors

Please or to participate in this conversation.